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 and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
context |
protected static CassandraPersistentEntityMetadataVerifier |
DEFAULT_VERIFIER |
protected Boolean |
forceQuote |
protected CassandraMappingContext |
mappingContext |
protected org.springframework.expression.spel.support.StandardEvaluationContext |
spelContext |
protected CqlIdentifier |
tableName |
protected CassandraPersistentEntityMetadataVerifier |
verifier |
Constructor and Description |
---|
BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation) |
BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation,
CassandraMappingContext mappingContext)
Creates a new
BasicCassandraPersistentEntity with the given TypeInformation . |
BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation,
CassandraMappingContext mappingContext,
CassandraPersistentEntityMetadataVerifier verifier)
Creates a new
BasicCassandraPersistentEntity with the given TypeInformation . |
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(org.springframework.data.mapping.Association<CassandraPersistentProperty> association) |
protected void |
addCompositePrimaryKeyProperties(CassandraPersistentEntity<?> compositePrimaryKeyEntity,
List<CassandraPersistentProperty> properties) |
protected CqlIdentifier |
determineDefaultName() |
protected CqlIdentifier |
determineName(String value,
boolean forceQuote) |
protected CqlIdentifier |
determineTableName() |
void |
doWithAssociations(org.springframework.data.mapping.AssociationHandler<CassandraPersistentProperty> handler) |
org.springframework.context.ApplicationContext |
getApplicationContext() |
List<CassandraPersistentProperty> |
getCompositePrimaryKeyProperties() |
CassandraMappingContext |
getMappingContext() |
CqlIdentifier |
getTableName()
Returns the table name to which the entity shall be persisted.
|
com.datastax.driver.core.UserType |
getUserType() |
CassandraPersistentEntityMetadataVerifier |
getVerifier() |
boolean |
isCompositePrimaryKey()
Returns whether this entity represents a composite primary key.
|
boolean |
isUserDefinedType() |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
setForceQuote(boolean forceQuote) |
void |
setTableName(CqlIdentifier tableName) |
void |
setVerifier(CassandraPersistentEntityMetadataVerifier verifier) |
void |
verify() |
addPersistentProperty, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isConstructorArgument, isIdProperty, isVersionProperty, returnPropertyIfBetterIdPropertyCandidateOrNull, setPersistentPropertyAccessorFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPersistentProperty, setPersistentPropertyAccessorFactory
doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getName, getPersistenceConstructor, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isConstructorArgument, isIdProperty, isVersionProperty
protected static final CassandraPersistentEntityMetadataVerifier DEFAULT_VERIFIER
protected org.springframework.context.ApplicationContext context
protected Boolean forceQuote
protected CassandraMappingContext mappingContext
protected CassandraPersistentEntityMetadataVerifier verifier
protected CqlIdentifier tableName
protected org.springframework.expression.spel.support.StandardEvaluationContext spelContext
public BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
public BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation, CassandraMappingContext mappingContext)
BasicCassandraPersistentEntity
with the given TypeInformation
. Will default the table
name to the entity's simple type name.typeInformation
- public BasicCassandraPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation, CassandraMappingContext mappingContext, CassandraPersistentEntityMetadataVerifier verifier)
BasicCassandraPersistentEntity
with the given TypeInformation
. Will default the table
name to the entity's simple type name.typeInformation
- 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 List<CassandraPersistentProperty> getCompositePrimaryKeyProperties()
getCompositePrimaryKeyProperties
in interface CassandraPersistentEntity<T>
protected void addCompositePrimaryKeyProperties(CassandraPersistentEntity<?> compositePrimaryKeyEntity, List<CassandraPersistentProperty> properties)
public void verify() throws org.springframework.data.mapping.model.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.model.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 org.springframework.context.ApplicationContext getApplicationContext()
getApplicationContext
in interface CassandraPersistentEntity<T>
public void setForceQuote(boolean forceQuote)
setForceQuote
in interface CassandraPersistentEntity<T>
public CassandraMappingContext getMappingContext()
getMappingContext
in interface CassandraPersistentEntity<T>
public void setTableName(CqlIdentifier tableName)
setTableName
in interface CassandraPersistentEntity<T>
public CqlIdentifier getTableName()
CassandraPersistentEntity
getTableName
in interface CassandraPersistentEntity<T>
public void setVerifier(CassandraPersistentEntityMetadataVerifier verifier)
verifier
- The verifier to set.public CassandraPersistentEntityMetadataVerifier getVerifier()
public boolean isUserDefinedType()
isUserDefinedType
in interface CassandraPersistentEntity<T>
UserDefinedType
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
protected CqlIdentifier determineDefaultName()
protected CqlIdentifier determineName(String value, boolean forceQuote)
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.