Interface CassandraPersistentEntity<T>
- All Superinterfaces:
Iterable<CassandraPersistentProperty>, PersistentEntity<T, CassandraPersistentProperty>
- All Known Implementing Classes:
BasicCassandraPersistentEntity, BasicCassandraPersistentTupleEntity, CassandraUserTypePersistentEntity
public interface CassandraPersistentEntity<T>
extends PersistentEntity<T, CassandraPersistentProperty>
Cassandra specific
PersistentEntity abstraction.- Author:
- Alex Shvid, Matthew T. Adams, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescription@Nullable com.datastax.oss.driver.api.core.CqlIdentifierReturns a specific keyspace to which the entity shall be persisted.@Nullable CassandraPersistentPropertygetProperty(Parameter<?, CassandraPersistentProperty> parameter) default com.datastax.oss.driver.api.core.CqlIdentifierReturns the required keyspace name or throwsIllegalStateExceptionif the entity isn't associated with a specific keyspace.com.datastax.oss.driver.api.core.CqlIdentifierReturns the table name to which the entity shall be persisted.default booleanReturnstrueif the entity is associated with a specific keyspace;falseotherwise.booleanReturns whether this entity represents a composite primary key.booleanbooleanvoidsetKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace) Sets the CQL keyspace.voidsetTableName(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Sets the CQL table name.Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface PersistentEntity
doWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
-
Method Details
-
getProperty
@Nullable CassandraPersistentProperty getProperty(Parameter<?, CassandraPersistentProperty> parameter) Retrieve aCassandraPersistentPropertyfrom apersistence creator (constructor/factory method) parameter. Parameters are either derived by name or synthesized if their name does not map to a existing property.- Parameters:
parameter- the parameter to create a property from. Parameters without a name return no (null) parameter.- Returns:
- the property, synthetic property or null, if the parameter is unnamed.
- Since:
- 4.2.3
-
isCompositePrimaryKey
boolean isCompositePrimaryKey()Returns whether this entity represents a composite primary key. -
getTableName
com.datastax.oss.driver.api.core.CqlIdentifier getTableName()Returns the table name to which the entity shall be persisted. -
setTableName
void setTableName(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Sets the CQL table name.- Parameters:
tableName- must not be null.
-
getKeyspace
@Nullable com.datastax.oss.driver.api.core.CqlIdentifier getKeyspace()Returns a specific keyspace to which the entity shall be persisted. If the entity isn't associated with a specific keyspace, then the entity is persisted in the keyspace associated with the Cassandra session.- Since:
- 4.4
-
getRequiredKeyspace
default com.datastax.oss.driver.api.core.CqlIdentifier getRequiredKeyspace()Returns the required keyspace name or throwsIllegalStateExceptionif the entity isn't associated with a specific keyspace.- Returns:
- the required keyspace name.
- Throws:
IllegalStateException- if the entity isn't associated with a specific keyspace.- Since:
- 4.4
-
hasKeyspace
default boolean hasKeyspace()Returnstrueif the entity is associated with a specific keyspace;falseotherwise.- Returns:
trueif the entity is associated with a specific keyspace;falseotherwise.- Since:
- 4.4
-
setKeyspace
void setKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace) Sets the CQL keyspace.- Parameters:
keyspace- must not be null.- Since:
- 4.4
-
isTupleType
boolean isTupleType()- Returns:
- true if the type is a mapped tuple type.
- Since:
- 2.1
- See Also:
-
isUserDefinedType
boolean isUserDefinedType()- Returns:
- true if the type is a mapped user defined type.
- Since:
- 1.5
- See Also:
-