public class CassandraMappingContext extends AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty> implements ApplicationContextAware, BeanClassLoaderAware
MappingContext for Cassandra using CassandraPersistentEntity and
CassandraPersistentProperty as primary abstractions.| Constructor and Description |
|---|
CassandraMappingContext()
Create a new
CassandraMappingContext. |
CassandraMappingContext(UserTypeResolver userTypeResolver,
TupleTypeFactory tupleTypeFactory)
|
| Modifier and Type | Method and Description |
|---|---|
protected Optional<BasicCassandraPersistentEntity<?>> |
addPersistentEntity(TypeInformation<?> typeInformation) |
protected <T> BasicCassandraPersistentEntity<T> |
createPersistentEntity(TypeInformation<T> typeInformation) |
protected CassandraPersistentProperty |
createPersistentProperty(Property property,
BasicCassandraPersistentEntity<?> owner,
SimpleTypeHolder simpleTypeHolder) |
com.datastax.driver.core.CodecRegistry |
getCodecRegistry() |
List<CreateIndexSpecification> |
getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity)
Deprecated.
will be removed in version 3.0 in favor of
SchemaFactory. |
CreateTableSpecification |
getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity)
Returns a
CreateTableSpecification for the given entity, including all mapping information. |
CreateTableSpecification |
getCreateTableSpecificationFor(CqlIdentifier tableName,
CassandraPersistentEntity<?> entity)
Deprecated.
will be removed in version 3.0 in favor of
SchemaFactory. |
CreateUserTypeSpecification |
getCreateUserTypeSpecificationFor(CassandraPersistentEntity<?> entity)
Deprecated.
will be removed in version 3.0 in favor of
SchemaFactory. |
com.datastax.driver.core.DataType |
getDataType(CassandraPersistentProperty property)
Deprecated.
will be removed in version 3.0 in favor of
ColumnTypeResolver. |
com.datastax.driver.core.DataType |
getDataType(Class<?> type)
Deprecated.
will be removed in version 3.0 in favor of
ColumnTypeResolver. |
Collection<BasicCassandraPersistentEntity<?>> |
getTableEntities()
Returns only
Table entities. |
com.datastax.driver.core.TupleType |
getTupleType(CassandraPersistentEntity<?> persistentEntity)
Deprecated.
will be removed in version 3.0 in favor of
ColumnTypeResolver. |
protected TupleTypeFactory |
getTupleTypeFactory() |
Collection<CassandraPersistentEntity<?>> |
getUserDefinedTypeEntities()
Returns only those entities representing a user defined type.
|
protected UserTypeResolver |
getUserTypeResolver() |
CassandraPersistentEntityMetadataVerifier |
getVerifier() |
void |
initialize() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanClassLoader(ClassLoader beanClassLoader) |
void |
setCodecRegistry(com.datastax.driver.core.CodecRegistry codecRegistry)
Sets the
CodecRegistry. |
void |
setCustomConversions(CustomConversions customConversions)
Sets the
CustomConversions. |
void |
setMapping(Mapping mapping)
Sets the
Mapping. |
void |
setTupleTypeFactory(TupleTypeFactory tupleTypeFactory)
Sets the
TupleTypeFactory. |
void |
setUserTypeResolver(UserTypeResolver userTypeResolver)
Sets the
UserTypeResolver. |
void |
setVerifier(CassandraPersistentEntityMetadataVerifier verifier) |
protected boolean |
shouldCreatePersistentEntityFor(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, doFindPersistentPropertyPaths, findPersistentPropertyPaths, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrictclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRequiredPersistentEntity, getRequiredPersistentEntity, getRequiredPersistentEntitypublic CassandraMappingContext()
CassandraMappingContext.public CassandraMappingContext(UserTypeResolver userTypeResolver, TupleTypeFactory tupleTypeFactory)
userTypeResolver - must not be null.tupleTypeFactory - must not be null.public void initialize()
initialize in class AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwaresetApplicationContext in class AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>BeansExceptionpublic void setBeanClassLoader(ClassLoader beanClassLoader)
setBeanClassLoader in interface BeanClassLoaderAwarepublic void setCustomConversions(CustomConversions customConversions)
CustomConversions.customConversions - must not be null.public void setMapping(Mapping mapping)
Mapping.mapping - must not be null.public Collection<BasicCassandraPersistentEntity<?>> getTableEntities()
Table entities.public Collection<CassandraPersistentEntity<?>> getUserDefinedTypeEntities()
public void setCodecRegistry(com.datastax.driver.core.CodecRegistry codecRegistry)
CodecRegistry.codecRegistry - must not be null.@NonNull public com.datastax.driver.core.CodecRegistry getCodecRegistry()
public void setTupleTypeFactory(TupleTypeFactory tupleTypeFactory)
TupleTypeFactory.tupleTypeFactory - must not be null.@NonNull protected TupleTypeFactory getTupleTypeFactory()
public void setUserTypeResolver(UserTypeResolver userTypeResolver)
UserTypeResolver.userTypeResolver - must not be null.@Nullable protected UserTypeResolver getUserTypeResolver()
public void setVerifier(CassandraPersistentEntityMetadataVerifier verifier)
verifier - The verifier to set.public CassandraPersistentEntityMetadataVerifier getVerifier()
protected Optional<BasicCassandraPersistentEntity<?>> addPersistentEntity(TypeInformation<?> typeInformation)
addPersistentEntity in class AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>protected boolean shouldCreatePersistentEntityFor(TypeInformation<?> typeInfo)
protected <T> BasicCassandraPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation)
createPersistentEntity in class AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>protected CassandraPersistentProperty createPersistentProperty(Property property, BasicCassandraPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder)
createPersistentProperty in class 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.@Deprecated public CreateTableSpecification getCreateTableSpecificationFor(CqlIdentifier tableName, CassandraPersistentEntity<?> entity)
SchemaFactory.CreateTableSpecification for the given entity using tableName, including all mapping
information.tableName - must not be null.entity - must not be null.@Deprecated public List<CreateIndexSpecification> getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity)
SchemaFactory.entity - must not be null.@Deprecated public CreateUserTypeSpecification getCreateUserTypeSpecificationFor(CassandraPersistentEntity<?> entity)
SchemaFactory.CreateUserTypeSpecification for the given entity, including all mapping information.entity - must not be null.@Deprecated public com.datastax.driver.core.DataType getDataType(Class<?> type)
ColumnTypeResolver.type. Cassandra types are determined using
simple types and configured CustomConversions.type - must not be null.type.CustomConversions,
CassandraSimpleTypeHolder@Deprecated public com.datastax.driver.core.TupleType getTupleType(CassandraPersistentEntity<?> persistentEntity)
ColumnTypeResolver.persistentEntity - @Deprecated public com.datastax.driver.core.DataType getDataType(CassandraPersistentProperty property)
ColumnTypeResolver.types are determined using simple types and
configured CustomConversions.property - must not be null.type.CustomConversions,
CassandraSimpleTypeHolderCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.