|
||||||||||
| 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 boolean |
allowsNull
Whether the container allows null elements/values. |
protected org.jpox.store.mapped.DatastoreAdapter |
dba
Datastore adapter in use by this store. |
protected static org.jpox.util.Localiser |
LOCALISER
Localiser for messages. |
protected org.jpox.store.mapped.mapping.JavaTypeMapping |
ownerMapping
Mapping to the owner of the container. |
protected org.jpox.metadata.AbstractMemberMetaData |
ownerMemberMetaData
MetaData for the field/property in the owner with this container. |
protected RDBMSManager |
storeMgr
Manager for the store. |
| Fields inherited from class org.jpox.store.rdbms.scostore.ElementContainerStore |
|---|
addStmt, clearStmt, clr, containerTable, elementInfo, elementIsPersistentInterface, elementMapping, elementsAreEmbedded, elementsAreSerialised, elementType, elmIdentifier, emd, iterateUsingDiscriminator, orderMapping, relationDiscriminatorMapping, relationDiscriminatorValue, removeStmt, usingDiscriminatorInSizeStmt |
| Constructor Summary | |
|---|---|
protected |
AbstractArrayStore(org.jpox.store.StoreManager storeMgr,
org.jpox.ClassLoaderResolver clr)
Constructor. |
| Method Summary | |
|---|---|
boolean |
add(org.jpox.StateManager sm,
java.lang.Object element,
int position)
Adds one element to the association owner vs elements |
protected boolean |
allowsBatching()
Convenience method to return if the RDBMS supports batching and the user wants batching. |
void |
clear(org.jpox.StateManager ownerSM)
Clear the association from owner to all elements. |
java.util.List |
getArray(org.jpox.StateManager ownerSM)
Accessor for the array from the datastore. |
org.jpox.store.mapped.expression.QueryExpression |
getExistsSubquery(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
org.jpox.store.mapped.expression.LogicSetExpression ownerTe,
org.jpox.store.mapped.DatastoreIdentifier arrayTableAlias)
Query utility to generate an exists() statement for an element. |
protected abstract org.jpox.store.mapped.expression.QueryExpression |
getIteratorStatement(org.jpox.StateManager ownerSM)
Accessor for the statement for the iterator. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getOwnerMapping()
Accessor for the owner mapping. |
org.jpox.store.mapped.expression.QueryExpression |
getSizeSubquery(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
org.jpox.store.mapped.expression.LogicSetExpression ownerTe,
org.jpox.store.mapped.DatastoreIdentifier arrayTableAlias)
Query utility to generate a subquery for the size() of the collection. |
protected org.jpox.StateManager |
getStateManagerForEmbeddedPCObject(org.jpox.StateManager sm,
java.lang.Object obj,
JoinTable table)
Method to return the StateManager for an embedded PC object (element, key, value). |
org.jpox.store.StoreManager |
getStoreManager()
Accessor for the RDBMSManager. |
protected int[] |
internalAdd(org.jpox.StateManager sm,
java.lang.Object element,
org.jpox.ManagedConnection conn,
boolean batched,
int orderId,
boolean executeNow)
Internal method to add a row to the join table. |
protected boolean |
isEmbeddedMapping(org.jpox.store.mapped.mapping.JavaTypeMapping mapping)
Check if the mapping correspond to a non pc object or embedded field |
java.util.Iterator |
iterator(org.jpox.StateManager ownerSM)
Accessor for an iterator through the array elements. |
protected int |
populateOwnerInStatement(org.jpox.StateManager sm,
org.jpox.ObjectManager om,
java.sql.PreparedStatement ps,
int jdbcPosition)
Convenience method to populate the passed PreparedStatement with the value from the owner. |
boolean |
set(org.jpox.StateManager ownerSM,
java.lang.Object array)
Method to set the array for the specified owner to the passed value. |
protected void |
setOwnerMemberMetaData(org.jpox.metadata.AbstractMemberMetaData mmd)
Method to set the owner field/property MetaData and sets whether null elements/values are allowed. |
| 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, size |
| Methods inherited from interface org.jpox.store.scostore.Store |
|---|
getStoreManager |
| Methods inherited from interface org.jpox.store.mapped.scostore.ArrayStoreQueryable |
|---|
joinElementsTo |
| Field Detail |
|---|
protected static final org.jpox.util.Localiser LOCALISER
protected RDBMSManager storeMgr
protected org.jpox.store.mapped.DatastoreAdapter dba
protected org.jpox.store.mapped.mapping.JavaTypeMapping ownerMapping
protected org.jpox.metadata.AbstractMemberMetaData ownerMemberMetaData
protected boolean allowsNull
| Constructor Detail |
|---|
protected AbstractArrayStore(org.jpox.store.StoreManager storeMgr,
org.jpox.ClassLoaderResolver clr)
storeMgr - Manager for the storeclr - ClassLoader resolver| Method Detail |
|---|
public java.util.List getArray(org.jpox.StateManager ownerSM)
getArray in interface org.jpox.store.scostore.ArrayStoreownerSM - SM for the owner
public void clear(org.jpox.StateManager ownerSM)
clear in interface org.jpox.store.scostore.ArrayStoreclear in class ElementContainerStoreownerSM - State Manager for the container.
public boolean set(org.jpox.StateManager ownerSM,
java.lang.Object array)
set in interface org.jpox.store.scostore.ArrayStoreownerSM - State Manager for the ownerarray - the array
public boolean add(org.jpox.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 int[] internalAdd(org.jpox.StateManager sm,
java.lang.Object element,
org.jpox.ManagedConnection conn,
boolean batched,
int orderId,
boolean executeNow)
throws java.sql.SQLException
sm - StateManager for the owner of the collectionelement - The element to add the relation toconn - The connectionbatched - Whether we are batchingorderId - The order id to use for this element relationexecuteNow - Whether to execute the statement now (and not wait for any batch)
java.sql.SQLException - Thrown if an error occursprotected abstract org.jpox.store.mapped.expression.QueryExpression getIteratorStatement(org.jpox.StateManager ownerSM)
ownerSM - the owner StateManager
public java.util.Iterator iterator(org.jpox.StateManager ownerSM)
iterator in interface org.jpox.store.scostore.ArrayStoreiterator in class ElementContainerStoreownerSM - State Manager for the container.
public org.jpox.store.mapped.expression.QueryExpression getExistsSubquery(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
org.jpox.store.mapped.expression.LogicSetExpression ownerTe,
org.jpox.store.mapped.DatastoreIdentifier arrayTableAlias)
SELECT 1 FROM JOINTABLE THIS_JOIN WHERE THIS_JOIN.OWNER_ID_OID = THIS.OWNER_ID
getExistsSubquery in interface org.jpox.store.mapped.scostore.ArrayStoreQueryableqs - The JDOQL query statementmapping - mapping of the fieldownerTe - Expression for the tablearrayTableAlias - alias for the array
public org.jpox.store.mapped.expression.QueryExpression getSizeSubquery(org.jpox.store.mapped.expression.QueryExpression qs,
org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
org.jpox.store.mapped.expression.LogicSetExpression ownerTe,
org.jpox.store.mapped.DatastoreIdentifier arrayTableAlias)
SELECT COUNT(*) FROM JOINTABLE THIS_JOIN WHERE THIS_JOIN.OWNER_ID_OID = THIS.OWNER_ID
getSizeSubquery in interface org.jpox.store.mapped.scostore.ArrayStoreQueryableqs - The query statementmapping - mapping of the fieldownerTe - Expression for the tablearrayTableAlias - alias for the array
protected void setOwnerMemberMetaData(org.jpox.metadata.AbstractMemberMetaData mmd)
mmd - MetaData for the field/property owning this backing store.public org.jpox.store.StoreManager getStoreManager()
public org.jpox.store.mapped.mapping.JavaTypeMapping getOwnerMapping()
protected boolean isEmbeddedMapping(org.jpox.store.mapped.mapping.JavaTypeMapping mapping)
mapping - the mapping
protected int populateOwnerInStatement(org.jpox.StateManager sm,
org.jpox.ObjectManager om,
java.sql.PreparedStatement ps,
int jdbcPosition)
sm - State Managerom - Object Managerps - The PreparedStatementjdbcPosition - Position in JDBC statement to populate
protected org.jpox.StateManager getStateManagerForEmbeddedPCObject(org.jpox.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
protected boolean allowsBatching()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||