public class BasicCassandraMappingContext extends AbstractMappingContext<CassandraPersistentEntity<?>,CassandraPersistentProperty> implements CassandraMappingContext, ApplicationContextAware
MappingContext for Cassandra using CassandraPersistentEntity and
CassandraPersistentProperty as primary abstractions.| Modifier and Type | Field and Description |
|---|---|
protected ClassLoader |
beanClassLoader |
protected ApplicationContext |
context |
protected Map<Class<?>,CassandraPersistentEntity<?>> |
entitiesByType |
protected Map<CqlIdentifier,Set<CassandraPersistentEntity<?>>> |
entitySetsByTableName |
protected Mapping |
mapping |
protected Set<CassandraPersistentEntity<?>> |
nonPrimaryKeyEntities |
protected Set<CassandraPersistentEntity<?>> |
primaryKeyEntities |
protected CassandraPersistentEntityMetadataVerifier |
verifier |
| Constructor and Description |
|---|
BasicCassandraMappingContext()
Creates a new
BasicCassandraMappingContext. |
addPersistentEntity, addPersistentEntity, afterPropertiesSet, getManagedTypes, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrict, shouldCreatePersistentEntityForclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetManagedTypes, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityForprotected ApplicationContext context
protected ClassLoader beanClassLoader
protected CassandraPersistentEntityMetadataVerifier verifier
protected Mapping mapping
protected Map<Class<?>,CassandraPersistentEntity<?>> entitiesByType
protected Map<CqlIdentifier,Set<CassandraPersistentEntity<?>>> entitySetsByTableName
protected Set<CassandraPersistentEntity<?>> nonPrimaryKeyEntities
protected Set<CassandraPersistentEntity<?>> primaryKeyEntities
public BasicCassandraMappingContext()
BasicCassandraMappingContext.public void initialize()
initialize in class AbstractMappingContext<CassandraPersistentEntity<?>,CassandraPersistentProperty>public Collection<CassandraPersistentEntity<?>> getPersistentEntities()
CassandraMappingContextgetPersistentEntities in interface CassandraMappingContextgetPersistentEntities in interface MappingContext<CassandraPersistentEntity<?>,CassandraPersistentProperty>getPersistentEntities in class AbstractMappingContext<CassandraPersistentEntity<?>,CassandraPersistentProperty>CassandraMappingContext.getPersistentEntities(boolean)public Collection<CassandraPersistentEntity<?>> getPrimaryKeyEntities()
CassandraMappingContextgetPrimaryKeyEntities in interface CassandraMappingContextpublic Collection<CassandraPersistentEntity<?>> getNonPrimaryKeyEntities()
CassandraMappingContextgetNonPrimaryKeyEntities in interface CassandraMappingContextCassandraMappingContext.getPersistentEntities(boolean)public Collection<CassandraPersistentEntity<?>> getPersistentEntities(boolean includePrimaryKeyTypes)
CassandraMappingContextgetPersistentEntities in interface CassandraMappingContextincludePrimaryKeyTypes - If true, returns all entities, including entities that represent primary
key types. If false, returns only entities that don't represent primary key types.public CassandraPersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor, CassandraPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder)
createPersistentProperty in class AbstractMappingContext<CassandraPersistentEntity<?>,CassandraPersistentProperty>public CassandraPersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor, CassandraPersistentEntity<?> owner, CassandraSimpleTypeHolder simpleTypeHolder)
protected <T> CassandraPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation)
createPersistentEntity in class AbstractMappingContext<CassandraPersistentEntity<?>,CassandraPersistentProperty>public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic boolean usesTable(com.datastax.driver.core.TableMetadata table)
CassandraMappingContextusesTable in interface CassandraMappingContexttable - May not be null.public CreateTableSpecification getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity)
CassandraMappingContextCreateTableSpecification for the given entity, including all mapping information.getCreateTableSpecificationFor in interface CassandraMappingContextpublic void setMapping(Mapping mapping)
protected void processMappingOverrides()
protected void processMappingOverrides(CassandraPersistentEntity<?> entity, EntityMapping entityMapping)
protected void processMappingOverride(CassandraPersistentEntity<?> entity, PropertyMapping mapping)
public void setBeanClassLoader(ClassLoader beanClassLoader)
public CassandraPersistentEntity<?> getExistingPersistentEntity(Class<?> type)
CassandraMappingContextCassandraPersistentEntity for the given Class. If it is not yet known to this
CassandraMappingContext, an IllegalArgumentException is thrown.getExistingPersistentEntity in interface CassandraMappingContexttype - The class of the existing persistent entity.public boolean contains(Class<?> type)
CassandraMappingContextCassandraMappingContext already contains a CassandraPersistentEntity for the
given type.contains in interface CassandraMappingContextpublic CassandraPersistentEntityMetadataVerifier getVerifier()
public void setVerifier(CassandraPersistentEntityMetadataVerifier verifier)
CassandraMappingContextBasicCassandraPersistentEntityMetadataVerifiersetVerifier in interface CassandraMappingContextverifier - The verifier to set.Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.