|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.rdbms.scostore.ElementContainerStore
org.jpox.store.rdbms.scostore.AbstractCollectionStore
org.jpox.store.rdbms.scostore.MapValueSetStore
public class MapValueSetStore
Representation of the backing store for a MapValue Set. This is used where the user calls Map.values() and then wants to perform some operation on the resulting Collection. TODO Cater for embedded values.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jpox.store.rdbms.scostore.ElementContainerStore |
---|
ElementContainerStore.ElementInfo |
Field Summary | |
---|---|
protected java.lang.String |
addStmt
|
protected DatastoreAdapter |
dba
Datastore adapter in use by this store. |
protected static Localiser |
LOCALISER
Localiser for messages. |
protected AbstractPropertyMetaData |
ownerFieldMetaData
MetaData for the field in the owner with this container. |
protected JavaTypeMapping |
ownerMapping
Mapping to the owner of the container. |
protected java.lang.String |
removeStmt
|
protected java.lang.String |
setName
|
protected StoreManager |
storeMgr
Manager for the store. |
protected DatastoreIdentifier |
thisIdentifier
Identifier for the container in JDOQL queries. |
Fields inherited from class org.jpox.store.rdbms.scostore.AbstractCollectionStore |
---|
containsStmt |
Fields inherited from class org.jpox.store.rdbms.scostore.ElementContainerStore |
---|
clearStmt, clr, containerTable, elementInfo, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, elmIdentifier, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, sizeStmt |
Constructor Summary | |
---|---|
MapValueSetStore(DatastoreClass valueTable,
JavaTypeMapping ownerMapping,
MapStore mapStore,
ClassLoaderResolver clr)
Constructor. |
|
MapValueSetStore(MapTable mapTable,
MapStore mapStore,
ClassLoaderResolver clr)
Constructor. |
Method Summary | |
---|---|
boolean |
add(StateManager sm,
java.lang.Object element)
Method to add a value to the Map. |
boolean |
addAll(StateManager sm,
java.util.Collection elements)
Adds all elements from a collection to the association owner vs elements |
void |
clear(StateManager sm)
Method to clear the map. |
protected java.sql.ResultSet |
executeQuery(java.lang.String stmt,
java.sql.PreparedStatement ps)
Method to execute a PreparedStatement query, and return the ResultSet. |
protected int |
executeUpdate(java.lang.String stmt,
java.sql.PreparedStatement ps)
Method to execute a PreparedStatement. |
protected QueryExpression |
getIteratorStatement(StateManager ownerSM)
Accessor for the statement for the iterator. |
JavaTypeMapping |
getOwnerMapping()
Accessor for the owner mapping. |
protected java.lang.String |
getRemoveStmt()
Generate statement for deleting an item from the Set. |
protected StateManager |
getStateManagerForEmbeddedPCObject(StateManager sm,
java.lang.Object obj,
JoinTable table)
Method to return the StateManager for an embedded PC object (element, key, value). |
StoreManager |
getStoreManager()
Accessor for the RDBMSManager. |
protected void |
initialiseStatements()
Method to initialise the statements being used. |
protected boolean |
isEmbeddedMapping(JavaTypeMapping mapping)
Check if the mapping correspond to a non pc object or embedded field |
java.util.Iterator |
iterator(StateManager ownerSM)
Accessor for an iterator for the set. |
ScalarExpression |
joinElementsTo(QueryExpression stmt,
QueryExpression qs,
JavaTypeMapping ownerMapping,
LogicSetExpression te,
DatastoreIdentifier setRangeVar,
java.lang.Class filteredElementType,
ScalarExpression elmExpr,
DatastoreIdentifier elementRangeVar)
Method used in queries when contains() has been invoked. |
QueryExpression |
newQueryStatement(StateManager sm,
java.lang.String candidateClass)
Method to return a new Query Statement containing the candidate class. |
protected int |
populateOwnerInStatement(StateManager sm,
PersistenceManager pm,
java.sql.PreparedStatement ps,
int jdbcPosition)
Convenience method to populate the passed PreparedStatement with the value from the owner. |
boolean |
remove(StateManager sm,
java.lang.Object element)
Method to remove a value from the Map. |
boolean |
removeAll(StateManager sm,
java.util.Collection elements)
Remove all elements from a collection from the association owner vs elements. |
Methods inherited from class org.jpox.store.rdbms.scostore.AbstractCollectionStore |
---|
contains, getContainsStmt, getExistsSubquery, getSizeSubquery, getUpdateEmbeddedElementStmt, updateEmbeddedElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jpox.store.scostore.CollectionStore |
---|
contains, getElementType, getExistsSubquery, getSizeSubquery, hasOrderMapping, newResultObjectFactory, size, updateEmbeddedElement |
Methods inherited from interface org.jpox.store.scostore.Store |
---|
getOwnerMapping, getStoreManager |
Field Detail |
---|
protected java.lang.String setName
protected java.lang.String addStmt
protected java.lang.String removeStmt
protected static final Localiser LOCALISER
protected StoreManager storeMgr
protected DatastoreAdapter dba
protected JavaTypeMapping ownerMapping
protected AbstractPropertyMetaData ownerFieldMetaData
protected final DatastoreIdentifier thisIdentifier
Constructor Detail |
---|
public MapValueSetStore(MapTable mapTable, MapStore mapStore, ClassLoaderResolver clr)
mapTable
- Table used by the mapmapStore
- Store used by the mapclr
- The ClassLoaderResolverpublic MapValueSetStore(DatastoreClass valueTable, JavaTypeMapping ownerMapping, MapStore mapStore, ClassLoaderResolver clr)
valueTable
- Table for the valuesownerMapping
- Mapping to the ownermapStore
- Store used by the map.clr
- The ClassLoaderResolverMethod Detail |
---|
protected QueryExpression getIteratorStatement(StateManager ownerSM)
ownerSM
- the owner StateManager
public boolean add(StateManager sm, java.lang.Object element)
add
in interface CollectionStore
sm
- State Manager for the ownerelement
- The value to add
public boolean remove(StateManager sm, java.lang.Object element)
remove
in interface CollectionStore
sm
- State Manager for the ownerelement
- The value to remove
public void clear(StateManager sm)
clear
in interface CollectionStore
clear
in class ElementContainerStore
sm
- State Manager for the container.public QueryExpression newQueryStatement(StateManager sm, java.lang.String candidateClass)
CollectionStore
sm
- State Manager for the collection.candidateClass
- Class of the elements.
public ScalarExpression joinElementsTo(QueryExpression stmt, QueryExpression qs, JavaTypeMapping ownerMapping, LogicSetExpression te, DatastoreIdentifier setRangeVar, java.lang.Class filteredElementType, ScalarExpression elmExpr, DatastoreIdentifier elementRangeVar)
CollectionStore
stmt
- The Query Statementqs
- the parent Query Statement. If there is no parent, parentStmt
must be equals to stmt
ownerMapping
- the mapping for the owner.te
- Table Expression for the ownersetRangeVar
- The range variable for the "Collection" table.filteredElementType
- The Class Type for the filtered elementelmExpr
- The Expression for the elementelementRangeVar
- The SQL alias, or "range variable", to assign to the
expression or to the element table.
protected void initialiseStatements()
initialiseStatements
in class AbstractCollectionStore
public java.util.Iterator iterator(StateManager ownerSM)
iterator
in interface CollectionStore
iterator
in class ElementContainerStore
ownerSM
- State Manager for the set.
public boolean addAll(StateManager sm, java.util.Collection elements)
addAll
in interface CollectionStore
sm
- State Manager for the containerelements
- The elements to add
public boolean removeAll(StateManager sm, java.util.Collection elements)
removeAll
in interface CollectionStore
sm
- State Manager for the containerelements
- Collection of elements to remove
protected java.lang.String getRemoveStmt()
DELETE FROM SETTABLE WHERE OWNERCOL=? AND ELEMENTCOL = ? [AND DISCRIM = ?]
public StoreManager getStoreManager()
public JavaTypeMapping getOwnerMapping()
protected int executeUpdate(java.lang.String stmt, java.sql.PreparedStatement ps) throws java.sql.SQLException
stmt
- The statement textps
- The Prepared Statement
java.sql.SQLException
- Thrown if an error occursprotected java.sql.ResultSet executeQuery(java.lang.String stmt, java.sql.PreparedStatement ps) throws java.sql.SQLException
stmt
- The statement textps
- The Prepared Statement
java.sql.SQLException
- Thrown if an error occursprotected boolean isEmbeddedMapping(JavaTypeMapping mapping)
mapping
- the mapping
protected int populateOwnerInStatement(StateManager sm, PersistenceManager pm, java.sql.PreparedStatement ps, int jdbcPosition)
sm
- State Managerpm
- Persistence Managerps
- The PreparedStatementjdbcPosition
- Position in JDBC statement to populate
protected StateManager getStateManagerForEmbeddedPCObject(StateManager sm, java.lang.Object obj, JoinTable table)
sm
- State Manager of the ownerobj
- The embedded PC objecttable
- Join table where the objects are stored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |