Interface CassandraPersistentProperty
- All Superinterfaces:
ApplicationContextAware
,Aware
,PersistentProperty<CassandraPersistentProperty>
- All Known Implementing Classes:
BasicCassandraPersistentProperty
,BasicCassandraPersistentTupleProperty
,CachingCassandraPersistentProperty
public interface CassandraPersistentProperty
extends PersistentProperty<CassandraPersistentProperty>, ApplicationContextAware
Cassandra specific
PersistentProperty
extension.- Author:
- Alex Shvid, Matthew T. Adams, David T. Webb, Mark Paluch, John Blum, Christoph Strobl, Frank Spitulski, Aleksei Zotov
-
Method Summary
Modifier and TypeMethodDescriptionfindAnnotatedType
(Class<? extends Annotation> annotationType) Find anAnnotatedType
byannotationType
derived from the property type.com.datastax.oss.driver.api.core.CqlIdentifier
The name of the single column to which the property is persisted.The name of the element ordinal to which the property is persisted when the owning type is a mapped tuple.The ordering (ascending or descending) for the column.default com.datastax.oss.driver.api.core.CqlIdentifier
The name of the single column to which the property is persisted.default int
The required element ordinal to which the property is persisted when the owning type is a mapped tuple.boolean
Return whether the property has an explicitly configured column name.default boolean
Determines whether thisCassandraPersistentProperty
is persisted (mapped) to an element ordinal when the owning type is a mapped tuple.boolean
Whether the property is a cluster key column.boolean
Whether the property is a composite primary key.default boolean
boolean
Returns whether the property is aMap
.boolean
Whether the property is a partition key column.boolean
Whether the property is a partition key column or a cluster key columnboolean
Whether the property maps to a static column.void
setColumnName
(com.datastax.oss.driver.api.core.CqlIdentifier columnName) If this property is mapped with a single column, set the column name to the givenCqlIdentifier
.default void
setColumnName
(CqlIdentifier columnName) Deprecated.void
setForceQuote
(boolean forceQuote) Deprecated.since 3.0.Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.springframework.data.mapping.PersistentProperty
findAnnotation, findPropertyOrOwnerAnnotation, getAccessorForOwner, getActualType, getAssociation, getAssociationTargetType, getAssociationTargetTypeInformation, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityTypeInformation, getRawType, getRequiredAnnotation, getRequiredAssociation, getRequiredField, getRequiredGetter, getRequiredSetter, getRequiredWither, getSetter, getSpelExpression, getType, getTypeInformation, getWither, hasActualTypeAnnotation, isAnnotationPresent, isArray, isAssociation, isCollectionLike, isEntity, isIdProperty, isImmutable, isMap, isReadable, isTransient, isVersionProperty, isWritable, usePropertyAccess
-
Method Details
-
setColumnName
Deprecated.since 3.0, usesetColumnName(CqlIdentifier)
.If this property is mapped with a single column, set the column name to the givenCqlIdentifier
. If this property is not mapped by a single column, throwsIllegalStateException
. If the given column name is null,IllegalArgumentException
is thrown.- Parameters:
columnName
- must not be null.
-
setColumnName
void setColumnName(com.datastax.oss.driver.api.core.CqlIdentifier columnName) If this property is mapped with a single column, set the column name to the givenCqlIdentifier
. If this property is not mapped by a single column, throwsIllegalStateException
. If the given column name is null,IllegalArgumentException
is thrown.- Parameters:
columnName
- must not be null.
-
getColumnName
The name of the single column to which the property is persisted. -
getRequiredColumnName
default com.datastax.oss.driver.api.core.CqlIdentifier getRequiredColumnName()The name of the single column to which the property is persisted.- Throws:
IllegalStateException
- if the required column name is not available.- Since:
- 2.1
-
setForceQuote
Deprecated.since 3.0. The column name gets converted intoCqlIdentifier
hence it no longer requires an indication whether the name should be quoted.Whether to force-quote the column names of this property.- Parameters:
forceQuote
- true to enforce quoting.- See Also:
-
getColumnName()
CqlIdentifier.fromInternal(String)
-
hasExplicitColumnName
boolean hasExplicitColumnName()Return whether the property has an explicitly configured column name. Eg. viaColumn.value()
,PrimaryKey.value()
orPrimaryKeyColumn.name()
- Returns:
- true if a configured column name is present and non empty.
- Since:
- 3.4
-
getOrdinal
The name of the element ordinal to which the property is persisted when the owning type is a mapped tuple. -
getRequiredOrdinal
default int getRequiredOrdinal()The required element ordinal to which the property is persisted when the owning type is a mapped tuple.- Throws:
IllegalStateException
- if the required ordinal is not available.- Since:
- 2.1
-
hasOrdinal
default boolean hasOrdinal()Determines whether thisCassandraPersistentProperty
is persisted (mapped) to an element ordinal when the owning type is a mapped tuple.- Returns:
- a boolean value indicating whether this
CassandraPersistentProperty
is persisted (mapped) to an element ordinal when the owning type is a mapped tuple. - Since:
- 4.0
- See Also:
-
getPrimaryKeyOrdering
The ordering (ascending or descending) for the column. Valid only for primary key columns; returns null for non-primary key columns. -
isClusterKeyColumn
boolean isClusterKeyColumn()Whether the property is a cluster key column. -
isCompositePrimaryKey
boolean isCompositePrimaryKey()Whether the property is a composite primary key. -
isMapLike
boolean isMapLike()Returns whether the property is aMap
.- Returns:
- a boolean indicating whether this property type is a
Map
.
-
isPartitionKeyColumn
boolean isPartitionKeyColumn()Whether the property is a partition key column. -
isPrimaryKeyColumn
boolean isPrimaryKeyColumn()Whether the property is a partition key column or a cluster key column- See Also:
-
isStaticColumn
boolean isStaticColumn()Whether the property maps to a static column.- Since:
- 3.2
-
isEmbedded
default boolean isEmbedded()- Returns:
- true if the property should be embedded.
- Since:
- 3.0
-
findAnnotatedType
Find anAnnotatedType
byannotationType
derived from the property type. Annotated type is looked up by introspecting property field/accessors. Collection/Map-like types are introspected for type annotations within type arguments.- Parameters:
annotationType
- must not be null.- Returns:
- the annotated type or null.
- Since:
- 2.0
-
setColumnName(CqlIdentifier)
.