public class BasicCassandraPersistentProperty extends AnnotationBasedPersistentProperty<CassandraPersistentProperty> implements CassandraPersistentProperty, ApplicationContextAware
AnnotationBasedPersistentProperty implementation.isIdProperty, isVersionPropertyisIdProperty, isVersionPropertyCassandraPersistentProperty.PropertyToFieldNameConverter| Modifier and Type | Field and Description |
|---|---|
protected List<CqlIdentifier> |
columnNames
An unmodifiable list of this property's column names.
|
protected ApplicationContext |
context |
protected List<CqlIdentifier> |
explicitColumnNames
An unmodifiable list of this property's explicitly set column names.
|
protected Boolean |
forceQuote
Whether this property has been explicitly instructed to force quote column names.
|
protected StandardEvaluationContext |
spelContext |
association, field, information, name, owner, propertyDescriptor, rawType| Constructor and Description |
|---|
BasicCassandraPersistentProperty(Field field,
PropertyDescriptor propertyDescriptor,
CassandraPersistentEntity<?> owner,
CassandraSimpleTypeHolder simpleTypeHolder)
Creates a new
BasicCassandraPersistentProperty. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCompositePrimaryKeyColumnNames(CassandraPersistentEntity<?> compositePrimaryKeyEntity,
List<CqlIdentifier> columnNames) |
protected Association<CassandraPersistentProperty> |
createAssociation() |
protected CqlIdentifier |
createColumnName(String defaultName,
String overriddenName,
boolean forceQuote) |
protected List<CqlIdentifier> |
determineColumnNames() |
protected void |
ensureTypeArguments(int args,
int expected) |
Association<CassandraPersistentProperty> |
getAssociation() |
CqlIdentifier |
getColumnName()
The name of the single column to which the property is persisted.
|
List<CqlIdentifier> |
getColumnNames()
The names of the columns to which the property is persisted if this is a composite primary key property.
|
CassandraPersistentEntity<?> |
getCompositePrimaryKeyEntity()
Returns a
CassandraPersistentEntity representing the composite primary key class of this entity, or null if
this class does not use a composite primary key. |
List<CassandraPersistentProperty> |
getCompositePrimaryKeyProperties()
Gets the list of composite primary key properties that this composite primary key field is a placeholder for.
|
Class<?> |
getCompositePrimaryKeyType() |
TypeInformation<?> |
getCompositePrimaryKeyTypeInformation()
Returns a
TypeInformation representing the type of the composite primary key class of this entity, or null
if this class does not use a composite primary key. |
com.datastax.driver.core.DataType |
getDataType()
The column's data type.
|
protected com.datastax.driver.core.DataType |
getDataTypeFor(Class<?> javaType) |
protected com.datastax.driver.core.DataType |
getDataTypeFor(com.datastax.driver.core.DataType.Name typeName) |
CassandraPersistentEntity<?> |
getOwner() |
Ordering |
getPrimaryKeyOrdering()
The ordering (ascending or descending) for the column.
|
boolean |
isClusterKeyColumn()
Whether the property is a cluster key column.
|
boolean |
isCompositePrimaryKey()
Whether the property is a composite primary key.
|
boolean |
isIndexed()
Whether the property has a secondary index on this column.
|
boolean |
isPartitionKeyColumn()
Whether the property is a partition key column.
|
boolean |
isPrimaryKeyColumn()
Whether the property is a partition key column or a cluster key column
|
void |
setApplicationContext(ApplicationContext context) |
void |
setColumnName(CqlIdentifier columnName)
If this property is mapped with a single column, set the column name to the given
CqlIdentifier. |
void |
setColumnNames(List<CqlIdentifier> columnNames)
Sets this property's column names to the collection given.
|
void |
setForceQuote(boolean forceQuote)
Whether to force-quote the column names of this property.
|
findAnnotation, findPropertyOrOwnerAnnotation, getSpelExpression, isAnnotationPresent, isAssociation, isIdProperty, isTransient, isVersionProperty, isWritable, toString, usePropertyAccessequals, getActualType, getComponentType, getField, getGetter, getMapValueType, getName, getPersistentEntityType, getRawType, getSetter, getType, getTypeInformation, hashCode, isArray, isCollectionLike, isEntity, isMapclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindAnnotation, findPropertyOrOwnerAnnotation, getActualType, getComponentType, getField, getGetter, getMapValueType, getName, getPersistentEntityType, getRawType, getSetter, getSpelExpression, getType, getTypeInformation, isAnnotationPresent, isArray, isAssociation, isCollectionLike, isEntity, isIdProperty, isMap, isTransient, isVersionProperty, isWritable, usePropertyAccessprotected ApplicationContext context
protected StandardEvaluationContext spelContext
protected List<CqlIdentifier> columnNames
protected List<CqlIdentifier> explicitColumnNames
protected Boolean forceQuote
public BasicCassandraPersistentProperty(Field field, PropertyDescriptor propertyDescriptor, CassandraPersistentEntity<?> owner, CassandraSimpleTypeHolder simpleTypeHolder)
BasicCassandraPersistentProperty.field - the actual Field in the domain entity corresponding to this persistent entity.propertyDescriptor - a PropertyDescriptor for the corresponding property in the domain entity.owner - the containing object or CassandraPersistentEntity of this persistent property.simpleTypeHolder - mapping of Java [simple|wrapper] types to Cassandra data types.public void setApplicationContext(ApplicationContext context)
setApplicationContext in interface ApplicationContextAwarepublic CassandraPersistentEntity<?> getOwner()
getOwner in interface CassandraPersistentPropertygetOwner in interface PersistentProperty<CassandraPersistentProperty>getOwner in class AbstractPersistentProperty<CassandraPersistentProperty>public boolean isCompositePrimaryKey()
CassandraPersistentPropertyisCompositePrimaryKey in interface CassandraPersistentPropertypublic Class<?> getCompositePrimaryKeyType()
public TypeInformation<?> getCompositePrimaryKeyTypeInformation()
CassandraPersistentPropertyTypeInformation representing the type of the composite primary key class of this entity, or null
if this class does not use a composite primary key.getCompositePrimaryKeyTypeInformation in interface CassandraPersistentPropertypublic CqlIdentifier getColumnName()
CassandraPersistentPropertyIllegalStateException if this property is
mapped to multiple columns.getColumnName in interface CassandraPersistentPropertypublic Ordering getPrimaryKeyOrdering()
CassandraPersistentPropertygetPrimaryKeyOrdering in interface CassandraPersistentPropertypublic com.datastax.driver.core.DataType getDataType()
CassandraPersistentPropertygetDataType in interface CassandraPersistentPropertypublic boolean isIndexed()
CassandraPersistentPropertyisIndexed in interface CassandraPersistentPropertypublic boolean isPartitionKeyColumn()
CassandraPersistentPropertyisPartitionKeyColumn in interface CassandraPersistentPropertypublic boolean isClusterKeyColumn()
CassandraPersistentPropertyisClusterKeyColumn in interface CassandraPersistentPropertypublic boolean isPrimaryKeyColumn()
CassandraPersistentPropertyisPrimaryKeyColumn in interface CassandraPersistentPropertyCassandraPersistentProperty.isPartitionKeyColumn(),
CassandraPersistentProperty.isClusterKeyColumn()protected com.datastax.driver.core.DataType getDataTypeFor(com.datastax.driver.core.DataType.Name typeName)
protected com.datastax.driver.core.DataType getDataTypeFor(Class<?> javaType)
protected void ensureTypeArguments(int args,
int expected)
public List<CqlIdentifier> getColumnNames()
CassandraPersistentPropertygetColumnNames in interface CassandraPersistentPropertyprotected List<CqlIdentifier> determineColumnNames()
protected CqlIdentifier createColumnName(String defaultName, String overriddenName, boolean forceQuote)
protected void addCompositePrimaryKeyColumnNames(CassandraPersistentEntity<?> compositePrimaryKeyEntity, List<CqlIdentifier> columnNames)
public void setColumnName(CqlIdentifier columnName)
CassandraPersistentPropertyCqlIdentifier. If this
property is not mapped by a single column, throws IllegalStateException. If the given column name is null,
IllegalArgumentException is thrown.setColumnName in interface CassandraPersistentPropertypublic void setColumnNames(List<CqlIdentifier> columnNames)
CassandraPersistentPropertynull elements.setColumnNames in interface CassandraPersistentPropertypublic void setForceQuote(boolean forceQuote)
CassandraPersistentPropertysetForceQuote in interface CassandraPersistentPropertyCassandraPersistentProperty.getColumnNames()public List<CassandraPersistentProperty> getCompositePrimaryKeyProperties()
CassandraPersistentPropertygetCompositePrimaryKeyProperties in interface CassandraPersistentPropertypublic CassandraPersistentEntity<?> getCompositePrimaryKeyEntity()
CassandraPersistentPropertyCassandraPersistentEntity representing the composite primary key class of this entity, or null if
this class does not use a composite primary key.getCompositePrimaryKeyEntity in interface CassandraPersistentPropertypublic Association<CassandraPersistentProperty> getAssociation()
getAssociation in interface PersistentProperty<CassandraPersistentProperty>getAssociation in class AbstractPersistentProperty<CassandraPersistentProperty>protected Association<CassandraPersistentProperty> createAssociation()
createAssociation in class AbstractPersistentProperty<CassandraPersistentProperty>Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.