Interface MongoPersistentProperty

All Superinterfaces:
PersistentProperty<MongoPersistentProperty>
All Known Implementing Classes:
BasicMongoPersistentProperty, CachingMongoPersistentProperty

public interface MongoPersistentProperty extends PersistentProperty<MongoPersistentProperty>
MongoDB specific PersistentProperty extension.
Author:
Oliver Gierke, Patryk Wasik, Thomas Darimont, Christoph Strobl, Divya Srivastava
  • Method Details

    • getFieldName

      String getFieldName()
      Returns the name of the field a property is persisted to.
      Returns:
    • hasExplicitFieldName

      boolean hasExplicitFieldName()
      Returns whether the property uses an annotated field name through Field.
      Returns:
    • getFieldType

      Class<?> getFieldType()
      Returns the Java FieldType of the field a property is persisted to.
      Returns:
      Since:
      2.2
      See Also:
    • getFieldOrder

      int getFieldOrder()
      Returns the order of the field if defined. Will return -1 if undefined.
      Returns:
    • writeNullValues

      boolean writeNullValues()
      Returns whether the property should be written to the database if its value is null.
      Returns:
      Since:
      3.3
      See Also:
    • isDbReference

      boolean isDbReference()
      Returns whether the property is a DBRef. If this returns true you can expect getDBRef() to return an non-null value.
      Returns:
    • isDocumentReference

      boolean isDocumentReference()
      Returns whether the property is a DocumentReference. If this returns true you can expect getDocumentReference() to return an non-null value.
      Returns:
      Since:
      3.3
    • isExplicitIdProperty

      boolean isExplicitIdProperty()
      Returns whether the property is explicitly marked as an identifier property of the owning PersistentEntity. A property is an explicit id property if it is annotated with @see Id.
      Returns:
    • isLanguageProperty

      boolean isLanguageProperty()
      Returns true whether the property indicates the documents language either by having a getFieldName() equal to language or being annotated with Language.
      Returns:
      Since:
      1.6
    • isExplicitLanguageProperty

      boolean isExplicitLanguageProperty()
      Returns true when property being annotated with Language.
      Returns:
      Since:
      1.6.1
    • isTextScoreProperty

      boolean isTextScoreProperty()
      Returns whether the property holds the documents score calculated by text search.
      It's marked with TextScore.
      Returns:
      Since:
      1.6
    • getDBRef

      @Nullable DBRef getDBRef()
      Returns the DBRef if the property is a reference.
      Returns:
      See Also:
    • getDocumentReference

      @Nullable DocumentReference getDocumentReference()
      Returns the DocumentReference if the property is a reference.
      Returns:
      null if not present.
      Since:
      3.3
      See Also:
    • usePropertyAccess

      boolean usePropertyAccess()
      Returns whether property access shall be used for reading the property value. This means it will use the getter instead of field access.
      Specified by:
      usePropertyAccess in interface PersistentProperty<MongoPersistentProperty>
      Returns:
    • hasExplicitWriteTarget

      default boolean hasExplicitWriteTarget()
      Returns:
      true if the property defines an explicit target type.
      Since:
      2.2
    • isUnwrapped

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

      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
    • getMongoField

      MongoField getMongoField()
      Returns:
      the MongoField representing the raw field to read/write in a MongoDB document.
      Since:
      4.2