org.jpox.store.scostore
Interface MapStore

All Superinterfaces:
Store
All Known Implementing Classes:
org.jpox.store.rdbms.scostore.AbstractMapStore

public interface MapStore
extends Store

Interface representation of the backing store for a Map.

Version:
$Revision: 1.16 $

Method Summary
 void clear(StateManager ownerSM)
          Method to clear the collection.
 boolean containsKey(StateManager ownerSM, java.lang.Object key)
          Accessor for whether the Map contains this key.
 boolean containsValue(StateManager ownerSM, java.lang.Object value)
          Accessor for whether the Map contains this value.
 SetStore entrySetStore()
          Accessor for the entry set for the Map.
 java.lang.Object get(StateManager ownerSM, java.lang.Object key)
          Accessor for a value from the Map.
 QueryExpression getExistsSubquery(QueryExpression stmt, JavaTypeMapping mapping, LogicSetExpression te, DatastoreIdentifier mapRangeVar)
          Create a subquery for the given query that joins a MapStore value table to the owner table.
 java.lang.String getKeyType()
          Accessor for the key type in the collection.
 QueryExpression getSizeSubquery(QueryExpression stmt, JavaTypeMapping mapping, LogicSetExpression te, DatastoreIdentifier mapRangeVar)
          Create a subquery for the size of the map.
 java.lang.String getValueType()
          Accessor for the value type in the collection.
 ScalarExpression joinKeysTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression te, DatastoreIdentifier mapRangeVar, java.lang.Class filteredKeyType, ScalarExpression keyExpr, DatastoreIdentifier keyRangeVar)
          Utility to create a join for keys to be used in a containsKey() query.
 ScalarExpression[] joinKeysToGet(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier mapRangeVar, java.lang.Class filteredKeyType, DatastoreIdentifier keyRangeVar, DatastoreIdentifier valueRangeVar)
          Used as part of the Querying of Maps where a get(Key) is used.
 ScalarExpression[] joinKeysValuesTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression te, DatastoreIdentifier mapRangeVar, java.lang.Class filteredKeyType, java.lang.Class filteredValueType, ScalarExpression keyExpr, ScalarExpression valExpr, DatastoreIdentifier keyRangeVar, DatastoreIdentifier valueRangeVar)
          Utility to create a join for keys and values to be used in ai containsEntry() query.
 ScalarExpression joinValuesTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier mapRangeVar, java.lang.Class filteredValueType, ScalarExpression valExpr, DatastoreIdentifier valueRangeVar)
          Used as part of the Querying of Maps where a containsValue() is used.
 boolean keysAreEmbedded()
          Accessor for whether the keys are embedded
 boolean keysAreSerialised()
          Accessor for whether the keys are serialised
 SetStore keySetStore(ClassLoaderResolver clr)
          Accessor for the keys in the Map.
 QueryExpression newQueryStatement(StateManager ownerSM, java.lang.String candidateClass)
          Method to create a query statement for a Map with values of the supplied candidate class.
 Query.ResultObjectFactory newResultObjectFactory(StateManager ownerSM, QueryExpression stmt, boolean ignoreCache, boolean useFetchPlan)
          Utility to create a Result Object Factory to process the results of selects returning values.
 java.lang.Object put(StateManager ownerSM, java.lang.Object key, java.lang.Object value)
          Method to add a value to the Map against this key.
 void putAll(StateManager ownerSM, java.util.Map m)
          Method to add a map of values to the Map.
 java.lang.Object remove(StateManager ownerSM, java.lang.Object key)
          Method to remove a value from the Map.
 boolean updateEmbeddedKey(StateManager sm, java.lang.Object key, int fieldNumber, java.lang.Object newValue)
          Method to update en embedded key in the collection.
 boolean updateEmbeddedValue(StateManager sm, java.lang.Object value, int fieldNumber, java.lang.Object newValue)
          Method to update en embedded value in the collection.
 boolean valuesAreEmbedded()
          Accessor for whether the values are embedded
 boolean valuesAreSerialised()
          Accessor for whether the values are serialised
 SetStore valueSetStore(ClassLoaderResolver clr)
          Accessor for the values in the Map.
 
Methods inherited from interface org.jpox.store.scostore.Store
getOwnerMapping, getStoreManager
 

Method Detail

getKeyType

public java.lang.String getKeyType()
Accessor for the key type in the collection.

Returns:
The key type.

getValueType

public java.lang.String getValueType()
Accessor for the value type in the collection.

Returns:
The value type.

keysAreEmbedded

public boolean keysAreEmbedded()
Accessor for whether the keys are embedded

Returns:
Whether we have embedded keys

keysAreSerialised

public boolean keysAreSerialised()
Accessor for whether the keys are serialised

Returns:
Whether we have serialised keys

valuesAreEmbedded

public boolean valuesAreEmbedded()
Accessor for whether the values are embedded

Returns:
Whether we have embedded values

valuesAreSerialised

public boolean valuesAreSerialised()
Accessor for whether the values are serialised

Returns:
Whether we have serialised values

containsValue

public boolean containsValue(StateManager ownerSM,
                             java.lang.Object value)
Accessor for whether the Map contains this value.

Parameters:
ownerSM - State Manager for the Map.
value - The value to check
Returns:
Whether it is contained.

containsKey

public boolean containsKey(StateManager ownerSM,
                           java.lang.Object key)
Accessor for whether the Map contains this key.

Parameters:
ownerSM - State Manager for the Map.
key - The key to check
Returns:
Whether it is contained.

get

public java.lang.Object get(StateManager ownerSM,
                            java.lang.Object key)
Accessor for a value from the Map.

Parameters:
ownerSM - State Manager for the Map.
key - Key for the value.
Returns:
Value for this key.

put

public java.lang.Object put(StateManager ownerSM,
                            java.lang.Object key,
                            java.lang.Object value)
Method to add a value to the Map against this key.

Parameters:
ownerSM - State Manager for the Map.
key - The key.
value - The value.
Returns:
Value that was previously against this key.

putAll

public void putAll(StateManager ownerSM,
                   java.util.Map m)
Method to add a map of values to the Map.

Parameters:
ownerSM - State Manager for the Map.
m - The map to add.

remove

public java.lang.Object remove(StateManager ownerSM,
                               java.lang.Object key)
Method to remove a value from the Map.

Parameters:
ownerSM - State Manager for the Map.
key - Key whose value is to be removed.
Returns:
Value that was removed.

clear

public void clear(StateManager ownerSM)
Method to clear the collection.

Parameters:
ownerSM - State Manager for the collection.

keySetStore

public SetStore keySetStore(ClassLoaderResolver clr)
Accessor for the keys in the Map.

Parameters:
clr - The ClassLoaderResolver
Returns:
Keys for the Map.

valueSetStore

public SetStore valueSetStore(ClassLoaderResolver clr)
Accessor for the values in the Map.

Parameters:
clr - The ClassLoaderResolver
Returns:
Values for the Map.

entrySetStore

public SetStore entrySetStore()
Accessor for the entry set for the Map.

Returns:
Entry set for the Map.

updateEmbeddedKey

public boolean updateEmbeddedKey(StateManager sm,
                                 java.lang.Object key,
                                 int fieldNumber,
                                 java.lang.Object newValue)
Method to update en embedded key in the collection.

Parameters:
sm - State Manager of the owner
key - The element
fieldNumber - Field to update in the key
newValue - The new value for the field
Returns:
Whether the element was modified

updateEmbeddedValue

public boolean updateEmbeddedValue(StateManager sm,
                                   java.lang.Object value,
                                   int fieldNumber,
                                   java.lang.Object newValue)
Method to update en embedded value in the collection.

Parameters:
sm - State Manager of the owner
value - The element
fieldNumber - Field to update in the value
newValue - The new value for the field
Returns:
Whether the element was modified

newQueryStatement

public QueryExpression newQueryStatement(StateManager ownerSM,
                                         java.lang.String candidateClass)
Method to create a query statement for a Map with values of the supplied candidate class.

Parameters:
ownerSM - StateManager for the Map
candidateClass - The class for the values
Returns:
The Query Statement.

newResultObjectFactory

public Query.ResultObjectFactory newResultObjectFactory(StateManager ownerSM,
                                                        QueryExpression stmt,
                                                        boolean ignoreCache,
                                                        boolean useFetchPlan)
Utility to create a Result Object Factory to process the results of selects returning values.

Parameters:
ownerSM - State Manager for the Map.
stmt - The Query Statement
ignoreCache - Whether to ignore the cache
useFetchPlan - whether to use the fetch plan to retrieve fields in the same query
Returns:
The result object factory.

getExistsSubquery

public QueryExpression getExistsSubquery(QueryExpression stmt,
                                         JavaTypeMapping mapping,
                                         LogicSetExpression te,
                                         DatastoreIdentifier mapRangeVar)
Create a subquery for the given query that joins a MapStore value table to the owner table. This subquery can subsequently be used in an EXISTS expression to determine whether a Map is empty or not.

Parameters:
stmt - The Query Statement to apply the join
mapping - Mapping for the owner
te - Table Expression for the owner
mapRangeVar - The range variable for the "Map" table.
Returns:
A subquery for the given query that joins a MapStore value table to the owner table.

getSizeSubquery

public QueryExpression getSizeSubquery(QueryExpression stmt,
                                       JavaTypeMapping mapping,
                                       LogicSetExpression te,
                                       DatastoreIdentifier mapRangeVar)
Create a subquery for the size of the map.

Parameters:
stmt - The Query Statement to apply the join
mapping - Mapping for the owner
te - Table Expression for the owner
mapRangeVar - The range variable for the "Map" table.
Returns:
A subquery for the size.

joinKeysValuesTo

public ScalarExpression[] joinKeysValuesTo(QueryExpression stmt,
                                           QueryExpression parentStmt,
                                           JavaTypeMapping ownerMapping,
                                           LogicSetExpression te,
                                           DatastoreIdentifier mapRangeVar,
                                           java.lang.Class filteredKeyType,
                                           java.lang.Class filteredValueType,
                                           ScalarExpression keyExpr,
                                           ScalarExpression valExpr,
                                           DatastoreIdentifier keyRangeVar,
                                           DatastoreIdentifier valueRangeVar)
Utility to create a join for keys and values to be used in ai containsEntry() query.

Parameters:
stmt - The Query Statement to apply the join
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
te - Table Expression for the owner
mapRangeVar - The SQL alias, or "range variable", to assign to the expression or to the main table.
filteredKeyType - The Class Type for the filtered key
filteredValueType - The Class Type for the filtered value
keyExpr - the expression to the key field
valExpr - Table Expression for the value
keyRangeVar - The SQL alias, or "range variable", to assign to the expression or to the key table.
valueRangeVar - The SQL alias, or "range variable", to assign to the expression or to the value table.
Returns:
an array with 2 elements of QueryColumnList. The first element contains the columns from the key mapping and the second element the columns from the value mapping

joinKeysTo

public ScalarExpression joinKeysTo(QueryExpression stmt,
                                   QueryExpression parentStmt,
                                   JavaTypeMapping ownerMapping,
                                   LogicSetExpression te,
                                   DatastoreIdentifier mapRangeVar,
                                   java.lang.Class filteredKeyType,
                                   ScalarExpression keyExpr,
                                   DatastoreIdentifier keyRangeVar)
Utility to create a join for keys to be used in a containsKey() query.

Parameters:
stmt - The Query Statement
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
te - Table Expression for the owner
mapRangeVar - The range variable for the "Map" table.
filteredKeyType - The Class Type for the filtered key
keyExpr - the expression to the key field. if not provided, obtain the expression of the ID of the table where filteredKeyType is stored
keyRangeVar - The SQL alias, or "range variable", to assign to the expression or to the key table.
Returns:
QueryColumnList with the columns from the key mapping

joinValuesTo

public ScalarExpression joinValuesTo(QueryExpression stmt,
                                     QueryExpression parentStmt,
                                     JavaTypeMapping ownerMapping,
                                     LogicSetExpression ownerTe,
                                     DatastoreIdentifier mapRangeVar,
                                     java.lang.Class filteredValueType,
                                     ScalarExpression valExpr,
                                     DatastoreIdentifier valueRangeVar)
Used as part of the Querying of Maps where a containsValue() is used.

Parameters:
stmt - The Query Statement
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
ownerTe - Table Expression for the owner
mapRangeVar - The range variable for the "Map" table.
filteredValueType - The Class Type for the filtered value
valExpr - the expression to the value field. if not provided, obtain the expression of the ID of the table where filteredValueType is stored
valueRangeVar - The SQL alias, or "range variable", to assign to the expression or to the value table.
Returns:
QueryColumnList with the columns from the value mapping

joinKeysToGet

public ScalarExpression[] joinKeysToGet(QueryExpression stmt,
                                        QueryExpression parentStmt,
                                        JavaTypeMapping ownerMapping,
                                        LogicSetExpression ownerTe,
                                        DatastoreIdentifier mapRangeVar,
                                        java.lang.Class filteredKeyType,
                                        DatastoreIdentifier keyRangeVar,
                                        DatastoreIdentifier valueRangeVar)
Used as part of the Querying of Maps where a get(Key) is used.

Parameters:
stmt - The Query Statement to apply the join
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
ownerTe - Table Expression for the owner
mapRangeVar - The SQL alias, or "range variable", to assign to the expression or to the main table.
filteredKeyType - The Class Type for the filtered key
keyRangeVar - The SQL alias, or "range variable", to assign to the expression or to the key table.
valueRangeVar - The SQL alias, or "range variable", to assign to the expression or to the value table.
Returns:
an array with 2 elements of QueryColumnList. The first element contains the columns from the key mapping and the second element the columns from the value mapping


Copyright © -2007 . All Rights Reserved.