public class ClassInfoImpl.POJOContext extends ClassInfoImpl.Context
POJOContext class provides a specific context for the POJO
as referenced while building an insert or update statement.| Modifier and Type | Field and Description |
|---|---|
protected T |
object
Holds the POJO object
|
keyspaceKeys| Constructor and Description |
|---|
POJOContext(T object)
Instantiates a new
POJOContext object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyspaceKey(String name)
Adds a keyspace key to the context for use in keyspace name creation by
retrieving its value from the associated POJO.
|
Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>> |
getColumnValue(String tname,
CharSequence name)
Retrieves the specified column value from the POJO and the specified
table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getColumnValues(String tname)
Retrieves all columns and their values from the POJO and the specified
table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getColumnValues(String tname,
CharSequence... names)
Retrieves the specified columns and their values from the POJO and the
specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getColumnValues(String tname,
Iterable<CharSequence> names)
Retrieves the specified columns and their values from the POJO and the
specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getKeyspaceAndPartitionKeyColumnValues(String tname)
Retrieves all keyspace and partition key columns and their values from the
POJO and the specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getKeyspaceAndPrimaryKeyColumnValues(String tname)
Retrieves all keyspace and primary key columns and their values from the
POJO and the specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getKeyspaceKeyValues()
Retrieves all keyspace keys and their values from the POJO.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getMandatoryAndPrimaryKeyColumnValues(String tname)
Retrieves all mandatory and primary key columns and their values from
the POJO and the specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getNonPrimaryKeyColumnValues(String tname)
Retrieves all non primary key columns and their values from
the POJO from the specified table.
|
T |
getObject()
Gets the POJO object associated with this context.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getPartitionKeyColumnValues(String tname)
Retrieves all partition key columns and their values from the POJO and the
specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getPrimaryKeyColumnValues(String tname)
Retrieves all primary key columns and their values from the POJO and the
specified table.
|
Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> |
getPrimaryKeyColumnValues(String tname,
Map<String,Object> pkeys_override)
Retrieves all primary key columns and their values from the POJO and the
specified table while giving priority to values provided by the specified
override map.
|
protected void |
populateKeyspaceKeys(Map<String,FieldInfoImpl<T>> fields)
Populates the keyspace keys defined in the given map from the POJO.
|
addKeyspaceKey, getClassInfo, getInitialObjects, getKeyspace, getObject, getObject, getObjectClassprotected final T object
public POJOContext(T object)
POJOContext object.object - the POJO objectNullPointerException - if object is nullIllegalArgumentException - if object is not of the
appropriate classprotected void populateKeyspaceKeys(Map<String,FieldInfoImpl<T>> fields)
fields - the map of keyspace key fields from the POJO where to extract
the keyspace key valuespublic T getObject()
public Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all column/value pairs for the POJOIllegalArgumentException - if a mandatory column is missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getPartitionKeyColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all partition key column/value pairs
for the POJOIllegalArgumentException - if a column is missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getKeyspaceAndPartitionKeyColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all keyspace key and partition key
column/value pairs for the POJOIllegalArgumentException - if a column or a keyspace key is missing from
the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getPrimaryKeyColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all primary key column/value pairs
for the POJOIllegalArgumentException - if a column is missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getPrimaryKeyColumnValues(String tname, Map<String,Object> pkeys_override)
tname - the name of the table from which to retrieve columnspkeys_override - a non-null map of primary key values
to use instead of those provided by the objectnull map of all primary key column/value pairs
for the POJOIllegalArgumentException - if a column is missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getKeyspaceKeyValues()
null map of all keyspace key name/value pairs
for the POJOIllegalArgumentException - if a keyspace key is missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getKeyspaceAndPrimaryKeyColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all keyspace key and primary key
column/value pairs for the POJOIllegalArgumentException - if a column or a keyspace key is missing from
the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getMandatoryAndPrimaryKeyColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all mandatory and primary key
column/value pairs for the POJOIllegalArgumentException - if a column is missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getNonPrimaryKeyColumnValues(String tname)
tname - the name of the table from which to retrieve columnsnull map of all non primary key column/value
pairs for the POJOIllegalArgumentException - if a mandatory column is missing from
the POJOpublic Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>> getColumnValue(String tname, CharSequence name)
tname - the name of the table from which to retrieve the columnname - the name of the column to retrieveIllegalArgumentException - if the column name is not defined by the
POJO or is mandatory and missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getColumnValues(String tname, Iterable<CharSequence> names)
tname - the name of the table from which to retrieve the columnnames - the names of the columns to retrievenull map of all requested column/value pairs
for the POJOIllegalArgumentException - if any of the column names are not defined
by the POJO or is mandatory and missing from the POJOpublic Map<String,Triple<Object,CQLDataType,com.datastax.driver.core.TypeCodec<?>>> getColumnValues(String tname, CharSequence... names)
tname - the name of the table from which to retrieve the columnnames - the names of the columns to retrievenull map of all requested column/value pairs
for the POJOIllegalArgumentException - if any of the column names are not defined
by the POJO or is mandatory and missing from the POJOpublic void addKeyspaceKey(String name)
name - the keyspace nameNullPointerException - if name is nullIllegalArgumentException - if the POJO doesn't require the specified
keyspace key or if the value doesn't match the POJO's definition for the
specified keyspace keyExcludedKeyspaceKeyException - if the specified keyspace key value is
marked as excluded the specified keyspace keyCopyright (C) 2015-2017 The Helenus Driver Project Authors.