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 newSchemaFactorygivenCassandraConverter.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 specificationsderived fromCassandraPersistentEntity.Returnsindex specificationsderived fromCassandraPersistentEntity.getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) getCreateTableSpecificationFor(Class<?> entityType) Returns aCreateTableSpecificationfor the given entity, including all mapping information.Returns aCreateTableSpecificationfor the given entity, including all mapping information.getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Returns aCreateTableSpecificationfor the given entity usingtable name, including all mapping information.Returns aCreateUserTypeSpecificationfor the given entity, including all mapping information.
-
Constructor Details
-
SchemaFactory
Creates a newSchemaFactorygivenCassandraConverter.- 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 aCreateTableSpecificationfor the given entity, including all mapping information.- Parameters:
entityType- must not be null.- Returns:
- the
CreateTableSpecificationderived fromentityType.
-
getCreateTableSpecificationFor
Returns aCreateTableSpecificationfor the given entity, including all mapping information.- Parameters:
entity- must not be null.- Returns:
- the
CreateTableSpecificationderived fromCassandraPersistentEntity.
-
getCreateTableSpecificationFor
public CreateTableSpecification getCreateTableSpecificationFor(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Returns aCreateTableSpecificationfor 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 specificationsderived fromCassandraPersistentEntity.- Parameters:
entityType- must not be null.- Returns:
- the
CreateTableSpecificationderived fromentityType.
-
getCreateIndexSpecificationsFor
public List<CreateIndexSpecification> getCreateIndexSpecificationsFor(CassandraPersistentEntity<?> entity) Returnsindex specificationsderived 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 aCreateUserTypeSpecificationfor the given entity, including all mapping information.- Parameters:
entity- must not be null.
-