Interface MongoPersistentEntity<T>

All Superinterfaces:
Iterable<MongoPersistentProperty>, org.springframework.data.mapping.model.MutablePersistentEntity<T,MongoPersistentProperty>, org.springframework.data.mapping.PersistentEntity<T,MongoPersistentProperty>
All Known Implementing Classes:
BasicMongoPersistentEntity

public interface MongoPersistentEntity<T> extends org.springframework.data.mapping.model.MutablePersistentEntity<T,MongoPersistentProperty>
MongoDB specific PersistentEntity abstraction.
Author:
Oliver Gierke, Christoph Strobl
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the collation of the entity evaluating a potential SpEL expression within the current context.
    Returns the collection the entity shall be persisted to.
     
    Returns the default language to be used for this entity.
    Get the entities shard key if defined.
    Returns the property holding text score value.
    default boolean
     
    boolean
    Returns whether the entity has a TextScore property.
    default boolean
     
    default boolean
     

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator

    Methods inherited from interface org.springframework.data.mapping.model.MutablePersistentEntity

    addAssociation, addPersistentProperty, setEvaluationContextProvider, setPersistentPropertyAccessorFactory, verify

    Methods inherited from interface org.springframework.data.mapping.PersistentEntity

    doWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
  • Method Details

    • getCollection

      String getCollection()
      Returns the collection the entity shall be persisted to.
      Returns:
    • getLanguage

      String getLanguage()
      Returns the default language to be used for this entity.
      Returns:
      Since:
      1.6
    • getTextScoreProperty

      @Nullable MongoPersistentProperty getTextScoreProperty()
      Returns the property holding text score value.
      Returns:
      null if not present.
      Since:
      1.6
      See Also:
    • hasTextScoreProperty

      boolean hasTextScoreProperty()
      Returns whether the entity has a TextScore property.
      Returns:
      true if property annotated with TextScore is present.
      Since:
      1.6
    • getCollation

      @Nullable Collation getCollation()
      Returns the collation of the entity evaluating a potential SpEL expression within the current context.
      Returns:
      null if not set.
      Since:
      2.2
    • hasCollation

      default boolean hasCollation()
      Returns:
      true if the entity is annotated with Collation.
      Since:
      2.2
    • getShardKey

      ShardKey getShardKey()
      Get the entities shard key if defined.
      Returns:
      ShardKey.none() if not not set.
      Since:
      3.0
    • isSharded

      default boolean isSharded()
      Returns:
      true if the shard key is sharded.
      Since:
      3.0
    • isUnwrapped

      default boolean isUnwrapped()
      Returns:
      true if the entity should be unwrapped.
      Since:
      3.2
    • getEncryptionKeyIds

      @Nullable Collection<Object> getEncryptionKeyIds()
      Returns:
      the resolved encryption keyIds if applicable. An empty Collection if no keyIds specified. null no Encrypted annotation found.
      Since:
      3.3