public class BasicCassandraPersistentEntity<T> extends org.springframework.data.mapping.model.BasicPersistentEntity<T,CassandraPersistentProperty> implements CassandraPersistentEntity<T>, org.springframework.context.ApplicationContextAware
BasicPersistentEntity
implementation that adds Cassandra specific metadata.Modifier | Constructor and Description |
---|---|
|
BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
Create a new
BasicCassandraPersistentEntity given TypeInformation . |
|
BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation,
CassandraPersistentEntityMetadataVerifier verifier)
Create a new
BasicCassandraPersistentEntity with the given TypeInformation . |
protected |
BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation,
CassandraPersistentEntityMetadataVerifier verifier,
Comparator<CassandraPersistentProperty> comparator)
Create a new
BasicCassandraPersistentEntity with the given TypeInformation . |
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(org.springframework.data.mapping.Association<CassandraPersistentProperty> association) |
protected CqlIdentifier |
determineTableName() |
void |
doWithAssociations(org.springframework.data.mapping.AssociationHandler<CassandraPersistentProperty> handler) |
CqlIdentifier |
getTableName()
Returns the table name to which the entity shall be persisted.
|
com.datastax.driver.core.TupleType |
getTupleType() |
com.datastax.driver.core.UserType |
getUserType() |
CassandraPersistentEntityMetadataVerifier |
getVerifier() |
boolean |
isCompositePrimaryKey()
Returns whether this entity represents a composite primary key.
|
boolean |
isTupleType() |
boolean |
isUserDefinedType() |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
setForceQuote(boolean forceQuote)
Sets whether to enforce quoting when using the
CassandraPersistentEntity.getTableName() in CQL. |
void |
setTableName(CqlIdentifier tableName)
Sets the CQL table name.
|
void |
setVerifier(CassandraPersistentEntityMetadataVerifier verifier) |
void |
verify() |
addPersistentProperty, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getEvaluationContext, getFallbackIsNewStrategy, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPropertyAccessor, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, iterator, requiresPropertyPopulation, returnPropertyIfBetterIdPropertyCandidateOrNull, setEvaluationContextProvider, setPersistentPropertyAccessorFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
forEach, iterator, spliterator
public BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
BasicCassandraPersistentEntity
given TypeInformation
.typeInformation
- must not be null.public BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation, CassandraPersistentEntityMetadataVerifier verifier)
BasicCassandraPersistentEntity
with the given TypeInformation
. Will default the table
name to the entity's simple type name.typeInformation
- must not be null.verifier
- must not be null.protected BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation, CassandraPersistentEntityMetadataVerifier verifier, Comparator<CassandraPersistentProperty> comparator)
BasicCassandraPersistentEntity
with the given TypeInformation
. Will default the table
name to the entity's simple type name.typeInformation
- must not be null.verifier
- must not be null.comparator
- must not be null.protected CqlIdentifier determineTableName()
public void addAssociation(org.springframework.data.mapping.Association<CassandraPersistentProperty> association)
addAssociation
in interface org.springframework.data.mapping.model.MutablePersistentEntity<T,CassandraPersistentProperty>
addAssociation
in class org.springframework.data.mapping.model.BasicPersistentEntity<T,CassandraPersistentProperty>
public void doWithAssociations(org.springframework.data.mapping.AssociationHandler<CassandraPersistentProperty> handler)
doWithAssociations
in interface org.springframework.data.mapping.PersistentEntity<T,CassandraPersistentProperty>
doWithAssociations
in class org.springframework.data.mapping.model.BasicPersistentEntity<T,CassandraPersistentProperty>
public boolean isCompositePrimaryKey()
CassandraPersistentEntity
isCompositePrimaryKey
in interface CassandraPersistentEntity<T>
public void verify() throws org.springframework.data.mapping.MappingException
verify
in interface org.springframework.data.mapping.model.MutablePersistentEntity<T,CassandraPersistentProperty>
verify
in class org.springframework.data.mapping.model.BasicPersistentEntity<T,CassandraPersistentProperty>
org.springframework.data.mapping.MappingException
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setForceQuote(boolean forceQuote)
CassandraPersistentEntity
CassandraPersistentEntity.getTableName()
in CQL.setForceQuote
in interface CassandraPersistentEntity<T>
forceQuote
- true to enforce quoting; false to disable enforced quoting usage.public void setTableName(CqlIdentifier tableName)
CassandraPersistentEntity
setTableName
in interface CassandraPersistentEntity<T>
tableName
- must not be null.public CqlIdentifier getTableName()
CassandraPersistentEntity
getTableName
in interface CassandraPersistentEntity<T>
public void setVerifier(CassandraPersistentEntityMetadataVerifier verifier)
verifier
- The verifier to set.public CassandraPersistentEntityMetadataVerifier getVerifier()
public boolean isTupleType()
isTupleType
in interface CassandraPersistentEntity<T>
Tuple
@Nullable public com.datastax.driver.core.TupleType getTupleType()
getTupleType
in interface CassandraPersistentEntity<T>
TupleType
matching the data types from mapped
tuple elements
.public boolean isUserDefinedType()
isUserDefinedType
in interface CassandraPersistentEntity<T>
UserDefinedType
@Nullable public com.datastax.driver.core.UserType getUserType()
getUserType
in interface CassandraPersistentEntity<T>
UserType
if the type is a mapped user defined type, otherwise null.UserDefinedType
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.