Class CassandraMappingContext
java.lang.Object
org.springframework.data.mapping.context.AbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
org.springframework.data.cassandra.core.mapping.CassandraMappingContext
- All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, InitializingBean, ApplicationContextAware, ApplicationEventPublisherAware, EnvironmentAware, MappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
public class CassandraMappingContext
extends AbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
implements ApplicationContextAware, BeanClassLoaderAware
Default implementation of a
MappingContext for Cassandra using CassandraPersistentEntity and
CassandraPersistentProperty as primary abstractions.- Author:
- Alex Shvid, Matthew T. Adams, Mark Paluch, John Blum, Jens Schauder, Vagif Zeynalov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<BasicCassandraPersistentEntity<?>> addPersistentEntity(TypeInformation<?> typeInformation) protected <T> BasicCassandraPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation) protected CassandraPersistentPropertycreatePersistentProperty(Property property, BasicCassandraPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) Returns onlyTableentities.Returns only those entities representing a user defined type.voidvoidsetApplicationContext(ApplicationContext applicationContext) voidsetBeanClassLoader(ClassLoader beanClassLoader) voidsetMapping(Mapping mapping) Sets theMapping.voidsetNamingStrategy(NamingStrategy namingStrategy) Set theNamingStrategyto use.voidprotected booleanshouldCreatePersistentEntityFor(TypeInformation<?> typeInfo) booleanusesTable(com.datastax.oss.driver.api.core.CqlIdentifier name) Returns whether this mapping context has any entities mapped to the given table.booleanusesUserType(com.datastax.oss.driver.api.core.CqlIdentifier name) Returns whether this mapping context has any entities using the given user type.Methods inherited from class AbstractMappingContext
addPersistentEntity, afterPropertiesSet, doFindPersistentPropertyPaths, findPersistentPropertyPaths, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, setApplicationEventPublisher, setBeanFactory, setEnvironment, setInitialEntitySet, setManagedTypes, setSimpleTypeHolder, setStrict, shouldCreatePropertiesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MappingContext
getRequiredPersistentEntity, getRequiredPersistentEntity, getRequiredPersistentEntity
-
Constructor Details
-
CassandraMappingContext
public CassandraMappingContext()Create a newCassandraMappingContext.
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classAbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Overrides:
setApplicationContextin classAbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>- Throws:
BeansException
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware
-
setMapping
-
getTableEntities
Returns onlyTableentities.- Since:
- 1.5
-
getUserDefinedTypeEntities
Returns only those entities representing a user defined type.- Since:
- 1.5
-
setNamingStrategy
Set theNamingStrategyto use.- Parameters:
namingStrategy- must not be null.- Since:
- 3.0
-
setVerifier
- Parameters:
verifier- The verifier to set.
-
getVerifier
- Returns:
- Returns the verifier.
-
addPersistentEntity
protected Optional<BasicCassandraPersistentEntity<?>> addPersistentEntity(TypeInformation<?> typeInformation) - Overrides:
addPersistentEntityin classAbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
-
shouldCreatePersistentEntityFor
- Overrides:
shouldCreatePersistentEntityForin classAbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
-
createPersistentEntity
protected <T> BasicCassandraPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation) - Specified by:
createPersistentEntityin classAbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
-
createPersistentProperty
protected CassandraPersistentProperty createPersistentProperty(Property property, BasicCassandraPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) - Specified by:
createPersistentPropertyin classAbstractMappingContext<BasicCassandraPersistentEntity<?>, CassandraPersistentProperty>
-
usesTable
public boolean usesTable(com.datastax.oss.driver.api.core.CqlIdentifier name) Returns whether this mapping context has any entities mapped to the given table.- Parameters:
name- must not be null.- Returns:
- true is this TableMetadata is used by a mapping.
-
usesUserType
public boolean usesUserType(com.datastax.oss.driver.api.core.CqlIdentifier name) Returns whether this mapping context has any entities using the given user type.- Parameters:
name- must not be null.- Returns:
- true is this UserType is used.
- Since:
- 1.5
-