|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.rdbms.scostore.BaseContainerStore
org.jpox.store.rdbms.scostore.MapEntrySetStore
Representation of backing store for a MapEntry Set.
Field Summary | |
protected ClassLoaderResolver |
clr
|
protected DatastoreAdapter |
dba
Datastore adapter in use by this store. |
protected java.lang.String |
iteratorStmt
|
protected JavaTypeMapping |
keyMapping
Mapping for the key (if not PC(embedded)). |
protected java.lang.String |
keyType
The key type. |
protected AbstractClassMetaData |
kmd
MetaData for the key class. |
protected static Localiser |
LOCALISER
Localiser for messages. |
protected MapStore |
mapStore
The backing store for the Map. |
protected AbstractPropertyMetaData |
ownerFieldMetaData
MetaData for the field in the owner with this container. |
protected JavaTypeMapping |
ownerMapping
Mapping to the owner of the container. |
protected DatastoreContainerObject |
setTable
Table containing the key and value forming the entry. |
protected java.lang.String |
sizeStmt
|
protected StoreManager |
storeMgr
Manager for the store. |
protected DatastoreIdentifier |
thisIdentifier
Identifier for the container in JDOQL queries. |
protected JavaTypeMapping |
valueMapping
Mapping for the value (if not PC(embedded)). |
protected java.lang.String |
valueType
The value type |
protected AbstractClassMetaData |
vmd
MetaData for the value class. |
Constructor Summary | |
MapEntrySetStore(DatastoreContainerObject valueTable,
JavaTypeMapping ownerMapping,
JavaTypeMapping keyMapping,
JavaTypeMapping valueMapping,
MapStore mapStore)
Constructor when using a ForeignKey Map. |
|
MapEntrySetStore(MapTable mapTable,
MapStore mapStore,
ClassLoaderResolver clr)
Constructor when using a JoinTable map. |
Method Summary | |
boolean |
add(StateManager sm,
java.lang.Object element)
Method to add an entry to the Map. |
boolean |
addAll(StateManager sm,
java.util.Collection elements)
Method to add entries to the Map. |
void |
clear(StateManager sm)
Method to clear the Map. |
boolean |
contains(StateManager sm,
java.lang.Object element)
Method to check if an element exists in the collection. |
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. |
java.lang.String |
getElementType()
Accessor for the element type. |
QueryExpression |
getExistsSubquery(QueryExpression stmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier collRangeVar)
Create a subquery for the given query that joins a SetStore element table to the owner table. |
JavaTypeMapping |
getOwnerMapping()
Accessor for the owner mapping. |
QueryExpression |
getSizeSubquery(QueryExpression stmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier collRangeVar)
Create a subquery for the size() of the collection of entries. |
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. |
boolean |
hasOrderMapping()
Accessor for whether this store has an order mapping to allow for duplicates, or ordering. |
protected boolean |
isEmbeddedMapping(JavaTypeMapping mapping)
Check if the mapping correspond to a non pc object or embedded field |
java.util.Iterator |
iterator(StateManager sm)
Accessor for an iterator for the entries of the Map. |
ScalarExpression |
joinElementsTo(QueryExpression stmt,
QueryExpression qs,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier collRangeVar,
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 QueryStatement. |
Query.ResultObjectFactory |
newResultObjectFactory(StateManager sm,
QueryExpression expr,
boolean useFetchPlan)
Method to return an object factory for processing map entry statements. |
Query.ResultObjectFactory |
newResultObjectFactory(StateManager sm,
QueryExpression stmt,
boolean ignoreCache,
boolean useFetchPlan)
Method to return an object factory for processing query statements. |
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 an entry from the Map. |
boolean |
removeAll(StateManager sm,
java.util.Collection elements)
Method to remove entries from the Map. |
int |
size(StateManager sm)
Accessor for the size of the Map. |
boolean |
updateEmbeddedElement(StateManager sm,
java.lang.Object element,
int fieldNumber,
java.lang.Object value)
Method to update an embedded element. |
protected boolean |
validateElementType(java.lang.Object element)
|
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.Store |
getStoreManager |
Field Detail |
protected DatastoreContainerObject setTable
protected MapStore mapStore
protected JavaTypeMapping keyMapping
protected JavaTypeMapping valueMapping
protected java.lang.String keyType
protected java.lang.String valueType
protected AbstractClassMetaData kmd
protected AbstractClassMetaData vmd
protected java.lang.String iteratorStmt
protected java.lang.String sizeStmt
protected ClassLoaderResolver clr
protected static final Localiser LOCALISER
protected StoreManager storeMgr
protected DatastoreAdapter dba
protected JavaTypeMapping ownerMapping
protected AbstractPropertyMetaData ownerFieldMetaData
protected final DatastoreIdentifier thisIdentifier
Constructor Detail |
public MapEntrySetStore(MapTable mapTable, MapStore mapStore, ClassLoaderResolver clr)
mapTable
- Table for the mapmapStore
- Store in use by the Mapclr
- ClassLoader resolverpublic MapEntrySetStore(DatastoreContainerObject valueTable, JavaTypeMapping ownerMapping, JavaTypeMapping keyMapping, JavaTypeMapping valueMapping, MapStore mapStore)
valueTable
- Table storing the valuesownerMapping
- Mapping to the ownerkeyMapping
- Mapping to the keyvalueMapping
- Mapping to the valuemapStore
- Store in use by the map.Method Detail |
public boolean hasOrderMapping()
hasOrderMapping
in interface CollectionStore
public boolean updateEmbeddedElement(StateManager sm, java.lang.Object element, int fieldNumber, java.lang.Object value)
updateEmbeddedElement
in interface CollectionStore
sm
- State Manager of the ownerelement
- The element to updatefieldNumber
- The number of the field to updatevalue
- The value
public java.lang.String getElementType()
getElementType
in interface CollectionStore
public JavaTypeMapping getOwnerMapping()
getOwnerMapping
in interface Store
protected boolean validateElementType(java.lang.Object element)
public java.util.Iterator iterator(StateManager sm)
iterator
in interface CollectionStore
sm
- State manager for the owner
public int size(StateManager sm)
size
in interface CollectionStore
sm
- The state manager
public boolean contains(StateManager sm, java.lang.Object element)
CollectionStore
contains
in interface CollectionStore
sm
- State Manager for the collection.element
- Element to check
public boolean add(StateManager sm, java.lang.Object element)
add
in interface CollectionStore
sm
- State Manager for the ownerelement
- Entry to add
public boolean addAll(StateManager sm, java.util.Collection elements)
addAll
in interface CollectionStore
sm
- State Manager for the ownerelements
- Entries to add
public boolean remove(StateManager sm, java.lang.Object element)
remove
in interface CollectionStore
sm
- State Manager for the ownerelement
- Entry to remove
public boolean removeAll(StateManager sm, java.util.Collection elements)
removeAll
in interface CollectionStore
sm
- State Manager for the ownerelements
- Entries to remove
public void clear(StateManager sm)
clear
in interface CollectionStore
sm
- State Manager for the owner.public Query.ResultObjectFactory newResultObjectFactory(StateManager sm, QueryExpression expr, boolean useFetchPlan)
sm
- the StateManagerexpr
- the QueryExpressionuseFetchPlan
- whether to use the FetchPlan
javax.jdo.JDOUnsupportedOptionException
- unsupported methodpublic QueryExpression newQueryStatement(StateManager sm, java.lang.String candidateClass)
newQueryStatement
in interface CollectionStore
sm
- StateManager for the collection.candidateClass
- The class to query
javax.jdo.JDOUnsupportedOptionException
- unsupported methodpublic Query.ResultObjectFactory newResultObjectFactory(StateManager sm, QueryExpression stmt, boolean ignoreCache, boolean useFetchPlan)
newResultObjectFactory
in interface CollectionStore
sm
- State Manager for the collection.stmt
- The Query Statement.ignoreCache
- Whether to ignore the cache.useFetchPlan
- whether to use the fetch plan to retrieve fields in the same query
javax.jdo.JDOUnsupportedOptionException
- unsupported methodpublic QueryExpression getExistsSubquery(QueryExpression stmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier collRangeVar)
getExistsSubquery
in interface CollectionStore
stmt
- The Query Statement.ownerMapping
- the mapping for the owner.ownerTe
- Table Expression for the ownercollRangeVar
- The range variable for the "Collection" table.
javax.jdo.JDOUnsupportedOptionException
- unsupported methodpublic QueryExpression getSizeSubquery(QueryExpression stmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier collRangeVar)
getSizeSubquery
in interface CollectionStore
stmt
- The Query Statement.ownerMapping
- the mapping for the owner.ownerTe
- Table Expression for the ownercollRangeVar
- The range variable for the "Collection" table.
javax.jdo.JDOUnsupportedOptionException
- unsupported methodpublic ScalarExpression joinElementsTo(QueryExpression stmt, QueryExpression qs, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier collRangeVar, java.lang.Class filteredElementType, ScalarExpression elmExpr, DatastoreIdentifier elementRangeVar)
joinElementsTo
in interface CollectionStore
stmt
- The Query StatementownerMapping
- the mapping for the owner.ownerTe
- Table Expression for the ownercollRangeVar
- 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.qs
- the parent Query Statement. If there is no parent, parentStmt
must be equals to stmt
javax.jdo.JDOUnsupportedOptionException
- unsupported methodpublic StoreManager getStoreManager()
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 |