public abstract class PersistenceSettings<F extends PojoField> extends Object implements Serializable
Constructor and Description |
---|
PersistenceSettings(Element el)
Constructs persistence settings from corresponding XML element.
|
Modifier and Type | Method and Description |
---|---|
List<F> |
cassandraUniqueFields()
List of POJO fields having unique mapping to Cassandra columns - skipping aliases pointing
to the same Cassandra table column.
|
protected void |
checkDuplicates(List<F> fields)
Checks if there are POJO filed with the same name or same Cassandra column specified in persistence settings.
|
protected abstract F |
createPojoField(Element el,
Class clazz)
Creates instance of
PojoField based on it's description in XML element. |
protected abstract F |
createPojoField(F field,
Class clazz)
Creates instance of
PojoField based on the other instance and java class
to initialize accessor. |
protected abstract F |
createPojoField(PojoFieldAccessor accessor)
Creates instance of
PojoField from its field accessor. |
protected abstract String |
defaultColumnName()
Returns default name for Cassandra column (if it's not specified explicitly).
|
protected List<F> |
detectPojoFields(NodeList fieldNodes)
Extracts POJO fields from a list of corresponding XML field nodes.
|
protected List<F> |
enrichFields(List<F> src)
Sets accessor for the given
src fields. |
static PropertyDescriptor |
findPropertyDescriptor(List<PropertyDescriptor> descriptors,
String propName)
Extracts property descriptor from the descriptors list by its name.
|
String |
getColumn()
Returns Cassandra table column name where object should be persisted in
case of using BLOB or PRIMITIVE persistence strategy.
|
PojoField |
getFieldByColumn(String column)
Returns POJO field by Cassandra table column name.
|
abstract List<F> |
getFields()
Returns a list of POJO fields to be persisted.
|
Class |
getJavaClass()
Returns java class of the object to be persisted.
|
Serializer |
getSerializer()
Returns serializer to be used for BLOBs.
|
PersistenceStrategy |
getStrategy()
Returns persistence strategy to use.
|
List<String> |
getTableColumns()
Returns set of database column names, used to persist field values
|
String |
getTableColumnsDDL()
Returns Cassandra table columns DDL, corresponding to POJO fields which should be persisted.
|
String |
getTableColumnsDDL(Set<String> ignoreColumns)
Returns Cassandra table columns DDL, corresponding to POJO fields which should be persisted.
|
protected void |
init()
Class instance initialization.
|
public PersistenceSettings(Element el)
el
- xml element containing persistence settings configuration.public static PropertyDescriptor findPropertyDescriptor(List<PropertyDescriptor> descriptors, String propName)
descriptors
- descriptors list.propName
- property name.public Class getJavaClass()
public PersistenceStrategy getStrategy()
public String getColumn()
public Serializer getSerializer()
public abstract List<F> getFields()
public PojoField getFieldByColumn(String column)
column
- column name.public List<F> cassandraUniqueFields()
public List<String> getTableColumns()
public String getTableColumnsDDL()
public String getTableColumnsDDL(Set<String> ignoreColumns)
ignoreColumns
- Table columns to ignore (exclude) from DDL.protected abstract String defaultColumnName()
protected abstract F createPojoField(Element el, Class clazz)
PojoField
based on it's description in XML element.el
- XML element describing POJO fieldclazz
- POJO java class.protected abstract F createPojoField(PojoFieldAccessor accessor)
PojoField
from its field accessor.accessor
- field accessor.protected abstract F createPojoField(F field, Class clazz)
PojoField
based on the other instance and java class
to initialize accessor.field
- PojoField instanceclazz
- java classprotected void init()
protected void checkDuplicates(List<F> fields)
fields
- List of fields to be persisted into Cassandra.protected List<F> detectPojoFields(NodeList fieldNodes)
fieldNodes
- Field nodes to process.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024