public class CassandraMappingContext extends org.springframework.data.mapping.context.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)
Deprecated.
since 3.0,
UserTypeResolver and TupleTypeFactory no longer required here as high-level
type resolution went into CassandraConverter . |
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) |
com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry |
getCodecRegistry()
Deprecated.
since 3.0. Retrieve
CodecRegistry directly from
CassandraConverter . |
org.springframework.data.convert.CustomConversions |
getCustomConversions()
Deprecated.
since 3.0. Use custom conversion through
MappingCassandraConverter . |
Collection<BasicCassandraPersistentEntity<?>> |
getTableEntities()
Returns only
Table entities. |
Collection<CassandraPersistentEntity<?>> |
getUserDefinedTypeEntities()
Returns only those entities representing a user defined type.
|
UserTypeResolver |
getUserTypeResolver()
Deprecated.
since 3.0. Retrieve
UserTypeResolver directly from
CassandraConverter . |
CassandraPersistentEntityMetadataVerifier |
getVerifier() |
void |
initialize() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanClassLoader(ClassLoader beanClassLoader) |
void |
setCodecRegistry(com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry codecRegistry)
Deprecated.
since 3.0. Set
CodecRegistry directly on
CassandraConverter . |
void |
setCustomConversions(org.springframework.data.convert.CustomConversions customConversions)
Deprecated.
since 3.0. Use custom conversion through
MappingCassandraConverter . |
void |
setMapping(Mapping mapping)
Sets the
Mapping . |
void |
setNamingStrategy(NamingStrategy namingStrategy)
Set the
NamingStrategy to use. |
void |
setTupleTypeFactory(TupleTypeFactory tupleTypeFactory)
Deprecated.
since 3.0. Tuple type creation uses
DataTypes.tupleOf(DataType...) |
void |
setUserTypeResolver(UserTypeResolver userTypeResolver)
Deprecated.
since 3.0. Set
UserTypeResolver directly on
CassandraConverter . |
void |
setVerifier(CassandraPersistentEntityMetadataVerifier verifier) |
protected boolean |
shouldCreatePersistentEntityFor(org.springframework.data.util.TypeInformation<?> typeInfo) |
boolean |
usesTable(com.datastax.oss.driver.api.core.CqlIdentifier name)
Returns whether this mapping context has any entities mapped to the given table.
|
boolean |
usesUserType(com.datastax.oss.driver.api.core.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, setStrict
public CassandraMappingContext()
CassandraMappingContext
.@Deprecated public CassandraMappingContext(UserTypeResolver userTypeResolver, TupleTypeFactory tupleTypeFactory)
UserTypeResolver
and TupleTypeFactory
no longer required here as high-level
type resolution went into CassandraConverter
.userTypeResolver
- must not be null.tupleTypeFactory
- must not be null.public void initialize()
initialize
in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
setApplicationContext
in class org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>,CassandraPersistentProperty>
BeansException
public void setBeanClassLoader(ClassLoader beanClassLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
@Deprecated public void setCustomConversions(org.springframework.data.convert.CustomConversions customConversions)
MappingCassandraConverter
.CustomConversions
.customConversions
- must not be null.@Deprecated public org.springframework.data.convert.CustomConversions getCustomConversions()
MappingCassandraConverter
.public void setMapping(Mapping mapping)
Mapping
.mapping
- must not be null.public Collection<BasicCassandraPersistentEntity<?>> getTableEntities()
Table
entities.public Collection<CassandraPersistentEntity<?>> getUserDefinedTypeEntities()
@Deprecated public void setCodecRegistry(com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry codecRegistry)
CodecRegistry
directly on
CassandraConverter
.CodecRegistry
.codecRegistry
- must not be null.@Deprecated public com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry getCodecRegistry()
CodecRegistry
directly from
CassandraConverter
.public void setNamingStrategy(NamingStrategy namingStrategy)
NamingStrategy
to use.namingStrategy
- must not be null.@Deprecated public void setTupleTypeFactory(TupleTypeFactory tupleTypeFactory)
DataTypes.tupleOf(DataType...)
TupleTypeFactory
.tupleTypeFactory
- must not be null.@Deprecated public void setUserTypeResolver(UserTypeResolver userTypeResolver)
UserTypeResolver
directly on
CassandraConverter
.UserTypeResolver
.userTypeResolver
- must not be null.@Nullable @Deprecated public UserTypeResolver getUserTypeResolver()
UserTypeResolver
directly from
CassandraConverter
.public void setVerifier(CassandraPersistentEntityMetadataVerifier verifier)
verifier
- The verifier to set.public CassandraPersistentEntityMetadataVerifier getVerifier()
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(com.datastax.oss.driver.api.core.CqlIdentifier name)
name
- must not be null.public boolean usesUserType(com.datastax.oss.driver.api.core.CqlIdentifier name)
name
- must not be null.Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.