Class SpannerCompositeKeyProperty

java.lang.Object
com.google.cloud.spring.data.spanner.core.mapping.SpannerCompositeKeyProperty
All Implemented Interfaces:
SpannerPersistentProperty, org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>

public class SpannerCompositeKeyProperty extends Object implements SpannerPersistentProperty
Represents an persistent property just to represent Cloud Spanner primary keys, and does not correspond to actual properties of POJOs, as it might even be a composite, multi-column key.
Since:
1.1
  • Constructor Details

  • Method Details

    • getColumnName

      public String getColumnName()
      Description copied from interface: SpannerPersistentProperty
      Gets the name of the column in the Google Cloud Spanner table mapped to this property.
      Specified by:
      getColumnName in interface SpannerPersistentProperty
      Returns:
      the name of the column.
    • getColumnInnerType

      public Class getColumnInnerType()
      Description copied from interface: SpannerPersistentProperty
      Gets the inner type of the column, which is meaningful for columns of type ARRAY in Google Cloud Spanner.
      Specified by:
      getColumnInnerType in interface SpannerPersistentProperty
      Returns:
      the inner type of the column.
    • getPrimaryKeyOrder

      public OptionalInt getPrimaryKeyOrder()
      Description copied from interface: SpannerPersistentProperty
      Gets the order of this column if it is part of the table's primary key. Will be empty or null if this column is not part of the primary key.
      Specified by:
      getPrimaryKeyOrder in interface SpannerPersistentProperty
      Returns:
      an optional that is empty if no primary key order exists for the property.
    • isMapped

      public boolean isMapped()
      Description copied from interface: SpannerPersistentProperty
      True if property corresponds to a column a Cloud Spanner table or child entities stored in Cloud Spanner. False otherwise.
      Specified by:
      isMapped in interface SpannerPersistentProperty
      Returns:
      true if this property will be mapped to and from Cloud Spanner. False otherwise.
    • isEmbedded

      public boolean isEmbedded()
      Description copied from interface: SpannerPersistentProperty
      True if the property is an embedded class containing more columns. False otherwise.
      Specified by:
      isEmbedded in interface SpannerPersistentProperty
      Returns:
      true if the property is embedded.
    • isInterleaved

      public boolean isInterleaved()
      Description copied from interface: SpannerPersistentProperty
      True if property is a collection of child entities. False otherwise.
      Specified by:
      isInterleaved in interface SpannerPersistentProperty
      Returns:
      true if property is a collection of child entities corresponding to an interleaved child table. False otherwise.
    • isGenerateSchemaNotNull

      public boolean isGenerateSchemaNotNull()
      Description copied from interface: SpannerPersistentProperty
      If the column's schema should be NOT NULL when generating a schema based on an entity class.
      Specified by:
      isGenerateSchemaNotNull in interface SpannerPersistentProperty
      Returns:
      true if the column should be NOT NULL in generated DDL. false otherwise.
    • isCommitTimestamp

      public boolean isCommitTimestamp()
      Description copied from interface: SpannerPersistentProperty
      If the column is a Cloud Spanner commit timestamp auto-populating column. This property is always stored in Cloud Spanner as a Timestamp, and will update based on the latest commit.
      Specified by:
      isCommitTimestamp in interface SpannerPersistentProperty
      Returns:
      true if the property is an auto-populated commit timestamp. false otherwise.
    • getAnnotatedColumnItemType

      public com.google.cloud.spanner.Type.Code getAnnotatedColumnItemType()
      Description copied from interface: SpannerPersistentProperty
      Optionally directly specify the column type in Cloud Spanner. For ARRAY columns this refers to type of the item the array holds. If this is not specified then it is inferred.
      Specified by:
      getAnnotatedColumnItemType in interface SpannerPersistentProperty
      Returns:
      the user-specified column item type.
    • isLazyInterleaved

      public boolean isLazyInterleaved()
      Description copied from interface: SpannerPersistentProperty
      Return whether this property is a lazily-fetched interleaved property.
      Specified by:
      isLazyInterleaved in interface SpannerPersistentProperty
      Returns:
      true if the property is lazily-fetched. false otherwise.
    • isEagerInterleaved

      public boolean isEagerInterleaved()
      Description copied from interface: SpannerPersistentProperty
      Return whether this property is an eagerly-fetched interleaved property.
      Specified by:
      isEagerInterleaved in interface SpannerPersistentProperty
      Returns:
      true if the property is eagerly-fetched. false otherwise.
    • getWhere

      public String getWhere()
      Description copied from interface: SpannerPersistentProperty
      Returns WHERE clause of the interleaved property or empty string if no value.
      Specified by:
      getWhere in interface SpannerPersistentProperty
      Returns:
      a WHERE clause of the interleaved property or empty string.
      See Also:
    • hasWhere

      public boolean hasWhere()
      Description copied from interface: SpannerPersistentProperty
      Returns true when the property has an annotation Where with a non-empty value.
      Specified by:
      hasWhere in interface SpannerPersistentProperty
      Returns:
      true when the property has an annotation Where with a non-empty value.
      See Also:
    • getMaxColumnLength

      public OptionalLong getMaxColumnLength()
      Description copied from interface: SpannerPersistentProperty
      Gets the maximum data length of the column if provided.
      Specified by:
      getMaxColumnLength in interface SpannerPersistentProperty
      Returns:
      an optional that is empty if no maximum length was provided.
    • getOwner

      public org.springframework.data.mapping.PersistentEntity<?,SpannerPersistentProperty> getOwner()
      Specified by:
      getOwner in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getName

      public String getName()
      Specified by:
      getName in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getType

      public Class<?> getType()
      Specified by:
      getType in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getTypeInformation

      public org.springframework.data.util.TypeInformation<?> getTypeInformation()
      Specified by:
      getTypeInformation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getGetter

      @Nullable public Method getGetter()
      Specified by:
      getGetter in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getSetter

      @Nullable public Method getSetter()
      Specified by:
      getSetter in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getField

      @Nullable public Field getField()
      Specified by:
      getField in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getSpelExpression

      @Nullable public String getSpelExpression()
      Specified by:
      getSpelExpression in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getAssociation

      @Nullable public org.springframework.data.mapping.Association<SpannerPersistentProperty> getAssociation()
      Specified by:
      getAssociation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isEntity

      public boolean isEntity()
      Specified by:
      isEntity in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isIdProperty

      public boolean isIdProperty()
      Specified by:
      isIdProperty in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isVersionProperty

      public boolean isVersionProperty()
      Specified by:
      isVersionProperty in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isCollectionLike

      public boolean isCollectionLike()
      Specified by:
      isCollectionLike in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isMap

      public boolean isMap()
      Specified by:
      isMap in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isArray

      public boolean isArray()
      Specified by:
      isArray in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isTransient

      public boolean isTransient()
      Specified by:
      isTransient in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isReadable

      public boolean isReadable()
      Specified by:
      isReadable in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isWritable

      public boolean isWritable()
      Specified by:
      isWritable in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isAssociation

      public boolean isAssociation()
      Specified by:
      isAssociation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getComponentType

      @Nullable public Class<?> getComponentType()
      Specified by:
      getComponentType in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getRawType

      public Class<?> getRawType()
      Specified by:
      getRawType in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getMapValueType

      @Nullable public Class<?> getMapValueType()
      Specified by:
      getMapValueType in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getActualType

      public Class<?> getActualType()
      Specified by:
      getActualType in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • findAnnotation

      @Nullable public <A extends Annotation> A findAnnotation(Class<A> annotationType)
      Specified by:
      findAnnotation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • findPropertyOrOwnerAnnotation

      @Nullable public <A extends Annotation> A findPropertyOrOwnerAnnotation(Class<A> annotationType)
      Specified by:
      findPropertyOrOwnerAnnotation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • isAnnotationPresent

      public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
      Specified by:
      isAnnotationPresent in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • usePropertyAccess

      public boolean usePropertyAccess()
      Specified by:
      usePropertyAccess in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getAssociationTargetType

      public Class<?> getAssociationTargetType()
      Returns null.
      Specified by:
      getAssociationTargetType in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
      Since:
      1.1
    • isImmutable

      public boolean isImmutable()
      Returns false.
      Specified by:
      isImmutable in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
      Since:
      1.1
    • getWither

      public Method getWither()
      Returns null.
      Specified by:
      getWither in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
      Since:
      1.1
    • getPersistentEntityTypeInformation

      public Iterable<? extends org.springframework.data.util.TypeInformation<?>> getPersistentEntityTypeInformation()
      Specified by:
      getPersistentEntityTypeInformation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
    • getAssociationTargetTypeInformation

      public org.springframework.data.util.TypeInformation<?> getAssociationTargetTypeInformation()
      Returns null for consistency with isAssociation().
      Specified by:
      getAssociationTargetTypeInformation in interface org.springframework.data.mapping.PersistentProperty<SpannerPersistentProperty>
      Returns:
      always null