Class SchemaFactory
java.lang.Object
org.springframework.data.cassandra.core.convert.SchemaFactory
Factory for Cassandra Schema objects such as user-defined types, tables and indexes.
- Since:
- 3.0
- Author:
- Mark Paluch, Christoph Strobl, Aleksei Zotov
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaFactory
(CassandraConverter converter) Creates a newSchemaFactory
givenCassandraConverter
.SchemaFactory
(MappingContext<? extends CassandraPersistentEntity<?>, CassandraPersistentProperty> mappingContext, CustomConversions customConversions, com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry codecRegistry) -
Method Summary
Modifier and TypeMethodDescriptiongetCreateIndexSpecificationsFor
(Class<?> entityType) Returnsindex specifications
derived fromCassandraPersistentEntity
.Returnsindex specifications
derived fromCassandraPersistentEntity
.getCreateIndexSpecificationsFor
(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) getCreateTableSpecificationFor
(Class<?> entityType) Returns aCreateTableSpecification
for the given entity, including all mapping information.Returns aCreateTableSpecification
for the given entity, including all mapping information.getCreateTableSpecificationFor
(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Returns aCreateTableSpecification
for the given entity usingtable name
, including all mapping information.Returns aCreateUserTypeSpecification
for the given entity, including all mapping information.
-
Constructor Details
-
SchemaFactory
Creates a newSchemaFactory
givenCassandraConverter
.- Parameters:
converter
- must not be null.
-
SchemaFactory
public SchemaFactory(MappingContext<? extends CassandraPersistentEntity<?>, CassandraPersistentProperty> mappingContext, CustomConversions customConversions, com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry codecRegistry) - Parameters:
mappingContext
- must not be null.customConversions
- must not be null.codecRegistry
- must not be null.
-
-
Method Details
-
getCreateTableSpecificationFor
Returns aCreateTableSpecification
for the given entity, including all mapping information.- Parameters:
entityType
- must not be null.- Returns:
- the
CreateTableSpecification
derived fromentityType
.
-
getCreateTableSpecificationFor
Returns aCreateTableSpecification
for the given entity, including all mapping information.- Parameters:
entity
- must not be null.- Returns:
- the
CreateTableSpecification
derived fromCassandraPersistentEntity
.
-
getCreateTableSpecificationFor
public CreateTableSpecification getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Returns aCreateTableSpecification
for the given entity usingtable name
, including all mapping information.- Parameters:
entity
- must not be null.tableName
- must not be null.- Returns:
- Since:
- 2.2
-
getCreateIndexSpecificationsFor
Returnsindex specifications
derived fromCassandraPersistentEntity
.- Parameters:
entityType
- must not be null.- Returns:
- the
CreateTableSpecification
derived fromentityType
.
-
getCreateIndexSpecificationsFor
public List<CreateIndexSpecification> getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity) Returnsindex specifications
derived fromCassandraPersistentEntity
.- Parameters:
entity
- must not be null.- Returns:
- Since:
- 2.0
-
getCreateIndexSpecificationsFor
public List<CreateIndexSpecification> getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) - Parameters:
entity
- must not be null.tableName
- must not be null.- Returns:
- Since:
- 2.0
-
getCreateUserTypeSpecificationFor
public CreateUserTypeSpecification getCreateUserTypeSpecificationFor(CassandraPersistentEntity<?> entity) Returns aCreateUserTypeSpecification
for the given entity, including all mapping information.- Parameters:
entity
- must not be null.
-