public class CassandraMappingContext extends org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty> implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanClassLoaderAware
MappingContext for Cassandra using CassandraPersistentEntity and
CassandraPersistentProperty as primary abstractions.| Constructor and Description |
|---|
CassandraMappingContext()
Create a new
CassandraMappingContext. |
| Modifier and Type | Method and Description |
|---|---|
protected Optional<BasicCassandraPersistentEntity<?>> |
addPersistentEntity(org.springframework.data.util.TypeInformation<?> typeInformation) |
protected <T> BasicCassandraPersistentEntity<T> |
createPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation) |
protected CassandraPersistentProperty |
createPersistentProperty(org.springframework.data.mapping.model.Property property,
BasicCassandraPersistentEntity<?> owner,
org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder) |
List<CreateIndexSpecification> |
getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity) |
CreateTableSpecification |
getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity)
Returns a
CreateTableSpecification for the given entity, including all mapping information. |
CreateUserTypeSpecification |
getCreateUserTypeSpecificationFor(CassandraPersistentEntity<?> entity)
Returns a
CreateUserTypeSpecification for the given entity, including all mapping information. |
com.datastax.driver.core.DataType |
getDataType(CassandraPersistentProperty property)
Retrieve the data type of the property.
|
com.datastax.driver.core.DataType |
getDataType(Class<?> type)
Retrieve the data type based on the given
type. |
Collection<BasicCassandraPersistentEntity<?>> |
getTableEntities()
Returns only
Table entities. |
Collection<CassandraPersistentEntity<?>> |
getUserDefinedTypeEntities()
Returns only those entities representing a user defined type.
|
CassandraPersistentEntityMetadataVerifier |
getVerifier() |
void |
initialize() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanClassLoader(ClassLoader beanClassLoader) |
void |
setCustomConversions(org.springframework.data.convert.CustomConversions customConversions)
Sets the
CustomConversions. |
void |
setMapping(Mapping mapping)
Sets the
Mapping. |
void |
setUserTypeResolver(UserTypeResolver userTypeResolver)
Sets the
UserTypeResolver. |
void |
setVerifier(CassandraPersistentEntityMetadataVerifier verifier) |
protected boolean |
shouldCreatePersistentEntityFor(org.springframework.data.util.TypeInformation<?> typeInfo) |
boolean |
usesTable(CqlIdentifier name)
Returns whether this mapping context has any entities mapped to the given table.
|
boolean |
usesUserType(CqlIdentifier name)
Returns whether this mapping context has any entities using the given user type.
|
addPersistentEntity, afterPropertiesSet, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrictpublic CassandraMappingContext()
CassandraMappingContext.public void initialize()
initialize in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setBeanClassLoader(ClassLoader beanClassLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwarepublic void setCustomConversions(org.springframework.data.convert.CustomConversions customConversions)
CustomConversions.customConversions - must not be null.public void setMapping(Mapping mapping)
Mapping.mapping - must not be null.public void setUserTypeResolver(UserTypeResolver userTypeResolver)
UserTypeResolver.userTypeResolver - must not be null.public void setVerifier(CassandraPersistentEntityMetadataVerifier verifier)
verifier - The verifier to set.public CassandraPersistentEntityMetadataVerifier getVerifier()
public Collection<BasicCassandraPersistentEntity<?>> getTableEntities()
Table entities.public Collection<CassandraPersistentEntity<?>> getUserDefinedTypeEntities()
protected Optional<BasicCassandraPersistentEntity<?>> addPersistentEntity(org.springframework.data.util.TypeInformation<?> typeInformation)
addPersistentEntity in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>protected boolean shouldCreatePersistentEntityFor(org.springframework.data.util.TypeInformation<?> typeInfo)
shouldCreatePersistentEntityFor in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>protected <T> BasicCassandraPersistentEntity<T> createPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
createPersistentEntity in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>protected CassandraPersistentProperty createPersistentProperty(org.springframework.data.mapping.model.Property property, BasicCassandraPersistentEntity<?> owner, org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder)
createPersistentProperty in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>public boolean usesTable(CqlIdentifier name)
name - must not be null.public boolean usesUserType(CqlIdentifier name)
name - must not be null.public CreateTableSpecification getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity)
CreateTableSpecification for the given entity, including all mapping information.entity - must not be null.public List<CreateIndexSpecification> getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity)
entity - must not be null.public CreateUserTypeSpecification getCreateUserTypeSpecificationFor(CassandraPersistentEntity<?> entity)
CreateUserTypeSpecification for the given entity, including all mapping information.entity - must not be null.public com.datastax.driver.core.DataType getDataType(CassandraPersistentProperty property)
types are determined using simple types and
configured CustomConversions.property - must not be null.type.CustomConversions,
CassandraSimpleTypeHolderpublic com.datastax.driver.core.DataType getDataType(Class<?> type)
type. Cassandra types are determined using
simple types and configured CustomConversions.type - must not be null.type.CustomConversions,
CassandraSimpleTypeHolderCopyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.