|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.mapped.scostore.BaseContainerStore
org.datanucleus.store.mapped.scostore.AbstractMapStore
public abstract class AbstractMapStore
Abstract representation of the backing store for a Map.
| Field Summary | |
|---|---|
protected boolean |
iterateUsingDiscriminator
Flag to set whether the iterator statement will use a discriminator or not. |
protected JavaTypeMapping |
keyMapping
Mapping to the key from the mapTable. |
protected boolean |
keysAreEmbedded
Whether the keys are embedded. |
protected boolean |
keysAreSerialised
Whether the keys are serialised. |
protected java.lang.String |
keyType
Type of the key. |
protected AbstractClassMetaData |
kmd
Metadata for the keys (if persistable). |
protected DatastoreContainerObject |
mapTable
Table storing the map relation. |
protected AbstractMapStoreSpecialization |
specialization
|
protected JavaTypeMapping |
valueMapping
Mapping to the value from the mapTable. |
protected boolean |
valuesAreEmbedded
Whether the values are embedded. |
protected boolean |
valuesAreSerialised
Whether the values are serialised. |
protected DatastoreClass |
valueTable
Table storing the values. |
protected java.lang.String |
valueType
Type of the value. |
protected AbstractClassMetaData |
vmd
Metadata for the values (if persistable). |
| Fields inherited from class org.datanucleus.store.mapped.scostore.BaseContainerStore |
|---|
allowsNull, dba, LOCALISER, ownerMapping, ownerMemberMetaData, relationType, storeMgr |
| Constructor Summary | |
|---|---|
AbstractMapStore(StoreManager storeMgr,
AbstractMapStoreSpecialization specialization)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
containsKey(StateManager sm,
java.lang.Object key)
Method to check if a key exists in the Map. |
boolean |
containsValue(StateManager sm,
java.lang.Object value)
Method to check if a value exists in the Map. |
java.lang.Object |
get(StateManager sm,
java.lang.Object key)
Method to return the value for a key. |
QueryExpression |
getExistsSubquery(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression ownerTe,
DatastoreIdentifier mapTableAlias)
Method used where a Query uses map.isEmpty(). |
JavaTypeMapping |
getKeyMapping()
|
java.lang.String |
getKeyType()
Accessor for the key type for storing in this Map. |
AbstractClassMetaData |
getKmd()
|
DatastoreContainerObject |
getMapTable()
|
QueryExpression |
getSizeSubquery(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression ownerTe,
DatastoreIdentifier mapTableAlias)
Query utility to generate a subquery for the size() of the map. |
protected abstract java.lang.Object |
getValue(StateManager sm,
java.lang.Object key)
Method to retrieve a value from the Map given the key. |
JavaTypeMapping |
getValueMapping()
|
java.lang.String |
getValueType()
Accessor for the value type for storing in this Map. |
AbstractClassMetaData |
getVmd()
|
boolean |
isValuesAreEmbedded()
|
boolean |
isValuesAreSerialised()
|
ScalarExpression[] |
joinKeysToGet(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression te,
DatastoreIdentifier mapTableAlias,
java.lang.Class filteredKeyType,
DatastoreIdentifier keyTableAlias,
DatastoreIdentifier valueTableAlias)
Used as part of the Querying of Maps where a get(Key) is used. |
boolean |
keysAreEmbedded()
Accessor for whether the keys are embedded or not. |
boolean |
keysAreSerialised()
Accessor for whether the keys are serialised or not. |
void |
putAll(StateManager sm,
java.util.Map m)
Method to put all elements from a Map into our Map. |
boolean |
updateEmbeddedKey(StateManager sm,
java.lang.Object key,
int fieldNumber,
java.lang.Object newValue)
Method to update a field of an embedded key. |
boolean |
updateEmbeddedValue(StateManager sm,
java.lang.Object value,
int fieldNumber,
java.lang.Object newValue)
Method to update a field of an embedded key. |
protected boolean |
validateKeyForReading(StateManager sm,
java.lang.Object key)
Utility to validate a key is ok for reading. |
protected void |
validateKeyForWriting(StateManager sm,
java.lang.Object key)
Utility to validate a key is ok for writing (present in the datastore). |
protected void |
validateKeyType(ClassLoaderResolver clr,
java.lang.Object key)
Utility to validate the type of a key for storing in the Map. |
protected boolean |
validateValueForReading(StateManager sm,
java.lang.Object value)
Utility to validate a value is ok for reading. |
protected void |
validateValueForWriting(StateManager sm,
java.lang.Object value)
Utility to validate a value is ok for writing (present in the datastore). |
protected void |
validateValueType(ClassLoaderResolver clr,
java.lang.Object value)
Utility to validate the type of a value for storing in the Map. |
boolean |
valuesAreEmbedded()
Accessor for whether the values are embedded or not. |
boolean |
valuesAreSerialised()
Accessor for whether the values are serialised or not. |
| Methods inherited from class org.datanucleus.store.mapped.scostore.BaseContainerStore |
|---|
allowsBatching, getDatastoreAdapter, getOwnerMapping, getOwnerMemberMetaData, getRelationType, getStateManagerForEmbeddedPCObject, getStoreManager, isEmbeddedMapping, setOwner |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.datanucleus.store.scostore.MapStore |
|---|
clear, entrySetStore, keySetStore, put, remove, valueSetStore |
| Methods inherited from interface org.datanucleus.store.scostore.Store |
|---|
getStoreManager |
| Methods inherited from interface org.datanucleus.store.mapped.expression.MapStoreQueryable |
|---|
joinKeysTo, joinKeysValuesTo, joinValuesTo |
| Field Detail |
|---|
protected boolean iterateUsingDiscriminator
protected DatastoreContainerObject mapTable
protected DatastoreClass valueTable
protected AbstractClassMetaData kmd
protected AbstractClassMetaData vmd
protected JavaTypeMapping keyMapping
protected JavaTypeMapping valueMapping
protected java.lang.String keyType
protected java.lang.String valueType
protected boolean keysAreEmbedded
protected boolean keysAreSerialised
protected boolean valuesAreEmbedded
protected boolean valuesAreSerialised
protected final AbstractMapStoreSpecialization specialization
| Constructor Detail |
|---|
public AbstractMapStore(StoreManager storeMgr,
AbstractMapStoreSpecialization specialization)
storeMgr - Manager for the storespecialization - Specialisation for this datastore| Method Detail |
|---|
public boolean keysAreEmbedded()
keysAreEmbedded in interface MapStorepublic boolean keysAreSerialised()
keysAreSerialised in interface MapStorepublic boolean valuesAreEmbedded()
valuesAreEmbedded in interface MapStorepublic boolean valuesAreSerialised()
valuesAreSerialised in interface MapStorepublic java.lang.String getKeyType()
getKeyType in interface MapStorepublic java.lang.String getValueType()
getValueType in interface MapStore
public boolean containsKey(StateManager sm,
java.lang.Object key)
containsKey in interface MapStoresm - State Manager for the mapkey - The key to check for.
public boolean containsValue(StateManager sm,
java.lang.Object value)
containsValue in interface MapStoresm - State Manager for the mapvalue - The value to check for.
public java.lang.Object get(StateManager sm,
java.lang.Object key)
get in interface MapStoresm - State Manager for the Map.key - The key of the object to retrieve.
public void putAll(StateManager sm,
java.util.Map m)
putAll in interface MapStoresm - State Manager for the Mapm - The Map to add
protected void validateKeyType(ClassLoaderResolver clr,
java.lang.Object key)
clr - The ClassLoaderResolverkey - The key to check.
protected void validateValueType(ClassLoaderResolver clr,
java.lang.Object value)
clr - The ClassLoaderResolvervalue - The value to check.
protected boolean validateKeyForReading(StateManager sm,
java.lang.Object key)
sm - State Manager for the map.key - The key to check.
protected boolean validateValueForReading(StateManager sm,
java.lang.Object value)
sm - State Manager for the map.value - The value to check.
protected void validateKeyForWriting(StateManager sm,
java.lang.Object key)
sm - State Manager for the map.key - The key to check.
protected void validateValueForWriting(StateManager sm,
java.lang.Object value)
sm - State Manager for the map.value - The value to check.
protected abstract java.lang.Object getValue(StateManager sm,
java.lang.Object key)
throws java.util.NoSuchElementException
sm - State Manager for the map.key - The key to retrieve the value for.
java.util.NoSuchElementException - if the value for the key was not found
public boolean updateEmbeddedKey(StateManager sm,
java.lang.Object key,
int fieldNumber,
java.lang.Object newValue)
updateEmbeddedKey in interface MapStoresm - State Manager of the ownerkey - The key to updatefieldNumber - The number of the field to updatenewValue - The new value
public boolean updateEmbeddedValue(StateManager sm,
java.lang.Object value,
int fieldNumber,
java.lang.Object newValue)
updateEmbeddedValue in interface MapStoresm - State Manager of the ownervalue - The value to updatefieldNumber - The number of the field to updatenewValue - The new value
public JavaTypeMapping getValueMapping()
public JavaTypeMapping getKeyMapping()
public boolean isValuesAreEmbedded()
public boolean isValuesAreSerialised()
public DatastoreContainerObject getMapTable()
public AbstractClassMetaData getKmd()
public AbstractClassMetaData getVmd()
public QueryExpression getExistsSubquery(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression ownerTe,
DatastoreIdentifier mapTableAlias)
getExistsSubquery in interface MapStoreQueryableqs - The QueryStatementmapping - The mapping of the java typeownerTe - The owner table expressionmapTableAlias - The alias for the "Map" table.
public QueryExpression getSizeSubquery(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression ownerTe,
DatastoreIdentifier mapTableAlias)
getSizeSubquery in interface MapStoreQueryableqs - The query statementmapping - mapping of the fieldownerTe - Expression for the tablemapTableAlias - alias for the map table
public ScalarExpression[] joinKeysToGet(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression te,
DatastoreIdentifier mapTableAlias,
java.lang.Class filteredKeyType,
DatastoreIdentifier keyTableAlias,
DatastoreIdentifier valueTableAlias)
joinKeysToGet in interface MapStoreQueryablestmt - The Query Statement to apply the joinparentStmt - the parent Query Statement. If there is no parent,
parentStmt must be equal to stmtownerMapping - Mapping for the owner.te - Table Expression for the ownermapTableAlias - The SQL alias to assign to the expression or to the main table.filteredKeyType - The Class Type for the filtered keykeyTableAlias - The SQL alias to assign to the expression or to the key table.valueTableAlias - The SQL alias to assign to the expression or to the value table.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||