|
||||||||||
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.AbstractArrayStore
public abstract class AbstractArrayStore
Abstract representation of the backing store for an array.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jpox.store.rdbms.scostore.ElementContainerStore |
---|
ElementContainerStore.ElementInfo |
Field Summary | |
---|---|
protected java.lang.String |
addStmt
Statement for adding an element to an array. |
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 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.ElementContainerStore |
---|
clearStmt, clr, containerTable, elementInfo, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, elmIdentifier, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, sizeStmt |
Constructor Summary | |
---|---|
protected |
AbstractArrayStore(StoreManager storeMgr,
ClassLoaderResolver clr)
Constructor. |
Method Summary | |
---|---|
boolean |
add(StateManager sm,
java.lang.Object element,
int position)
Adds one element to the association owner vs elements |
void |
clear(StateManager ownerSM)
Clear the association from owner to all elements. |
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.util.List |
getArray(StateManager ownerSM)
Method to retrieve the elements of the array. |
QueryExpression |
getExistsSubquery(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression ownerTe,
DatastoreIdentifier collectionRangeVar)
JDOQL utility to generate an exists() statement for an element. |
protected abstract QueryExpression |
getIteratorStatement(StateManager ownerSM)
Accessor for the statement for the iterator. |
JavaTypeMapping |
getOwnerMapping()
Accessor for the owner mapping. |
QueryExpression |
getSizeSubquery(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression ownerTe,
DatastoreIdentifier collectionRangeVar)
JDOQL utility to generate a subquery for the size() of the collection. |
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 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 through the array elements. |
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 |
set(StateManager ownerSM,
java.lang.Object array)
Method to set the array for the specified owner to the passed value. |
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.ArrayStore |
---|
getElementType, joinElementsTo, size |
Methods inherited from interface org.jpox.store.scostore.Store |
---|
getOwnerMapping, getStoreManager |
Field Detail |
---|
protected java.lang.String addStmt
protected static final Localiser LOCALISER
protected StoreManager storeMgr
protected DatastoreAdapter dba
protected JavaTypeMapping ownerMapping
protected AbstractPropertyMetaData ownerFieldMetaData
protected final DatastoreIdentifier thisIdentifier
Constructor Detail |
---|
protected AbstractArrayStore(StoreManager storeMgr, ClassLoaderResolver clr)
storeMgr
- Manager for the storeclr
- ClassLoader resolverMethod Detail |
---|
public java.util.List getArray(StateManager ownerSM)
ArrayStore
getArray
in interface ArrayStore
ownerSM
- State Manager of the owner
public void clear(StateManager ownerSM)
clear
in interface ArrayStore
clear
in class ElementContainerStore
ownerSM
- State Manager for the container.public boolean set(StateManager ownerSM, java.lang.Object array)
set
in interface ArrayStore
ownerSM
- State Manager for the ownerarray
- the array
public boolean add(StateManager sm, java.lang.Object element, int position)
sm
- State Manager for the containerelement
- The element to addposition
- The position to add this element at
protected abstract QueryExpression getIteratorStatement(StateManager ownerSM)
ownerSM
- the owner StateManager
public java.util.Iterator iterator(StateManager ownerSM)
iterator
in interface ArrayStore
iterator
in class ElementContainerStore
ownerSM
- State Manager for the container.
public QueryExpression getExistsSubquery(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression ownerTe, DatastoreIdentifier collectionRangeVar)
SELECT 1 FROM JOINTABLE THIS_JOIN WHERE THIS_JOIN.OWNER_ID_OID = THIS.OWNER_ID
getExistsSubquery
in interface ArrayStore
qs
- The JDOQL query statementmapping
- mapping of the fieldownerTe
- Expression for the tablecollectionRangeVar
- range variable for the collection
public QueryExpression getSizeSubquery(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression ownerTe, DatastoreIdentifier collectionRangeVar)
SELECT COUNT(*) FROM JOINTABLE THIS_JOIN WHERE THIS_JOIN.OWNER_ID_OID = THIS.OWNER_ID
getSizeSubquery
in interface ArrayStore
qs
- The JDOQL query statementmapping
- mapping of the fieldownerTe
- Expression for the tablecollectionRangeVar
- range variable for the collection
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 |