|
||||||||||
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
org.jpox.store.rdbms.scostore.FKArrayStore
public class FKArrayStore
Backing store for an array that is formed by a foreign key in the table of the element type. Only supported when the element is a PersistenceCapable type (since that has its own element table, capable of having a FK!)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jpox.store.rdbms.scostore.ElementContainerStore |
---|
ElementContainerStore.ElementInfo |
Field Summary | |
---|---|
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.AbstractArrayStore |
---|
addStmt |
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 | |
---|---|
FKArrayStore(AbstractPropertyMetaData fmd,
RDBMSManager storeMgr,
ClassLoaderResolver clr)
Constructor. |
Method Summary | |
---|---|
void |
clear(StateManager ownerSM)
Method to clear the Array. |
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 java.lang.String |
getClearNullifyStmt()
Generates the statement for clearing items by nulling the owner link out. |
protected QueryExpression |
getIteratorStatement(StateManager ownerSM)
Accessor for the iterator statement to retrieve the element(s) for the array. |
JavaTypeMapping |
getOwnerMapping()
Accessor for the owner mapping. |
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 |
ScalarExpression |
joinElementsTo(QueryExpression stmt,
QueryExpression parentStmt,
JavaTypeMapping ownerMapping,
LogicSetExpression ownerTe,
DatastoreIdentifier listRangeVar,
java.lang.Class filteredElementType,
ScalarExpression elmExpr,
DatastoreIdentifier elementRangeVar)
Method used in queries when contains() has been invoked. |
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 org.jpox.store.rdbms.scostore.AbstractArrayStore |
---|
add, getArray, getExistsSubquery, getSizeSubquery, iterator |
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 |
---|
getOwnerMapping, getStoreManager |
Field Detail |
---|
protected static final Localiser LOCALISER
protected StoreManager storeMgr
protected DatastoreAdapter dba
protected JavaTypeMapping ownerMapping
protected AbstractPropertyMetaData ownerFieldMetaData
protected final DatastoreIdentifier thisIdentifier
Constructor Detail |
---|
public FKArrayStore(AbstractPropertyMetaData fmd, RDBMSManager storeMgr, ClassLoaderResolver clr)
fmd
- Field MetaData for the field that this representsstoreMgr
- The Store Manager in useclr
- The ClassLoaderResolverMethod Detail |
---|
protected java.lang.String getClearNullifyStmt()
UPDATE ARRAYTABLE SET OWNERCOL=NULL, INDEXCOL=NULL [,DISTINGUISHER=NULL] WHERE OWNERCOL=? [AND DISTINGUISHER=?]when there is only one element table, and will be
UPDATE ? SET OWNERCOL=NULL, INDEXCOL=NULL [,DISTINGUISHER=NULL] WHERE OWNERCOL=? [AND DISTINGUISHER=?]when there is more than 1 element table.
public void clear(StateManager ownerSM)
clear
in interface ArrayStore
clear
in class AbstractArrayStore
ownerSM
- The state managerpublic boolean set(StateManager ownerSM, java.lang.Object array)
set
in interface ArrayStore
set
in class AbstractArrayStore
ownerSM
- State Manager for the ownerarray
- the array
protected QueryExpression getIteratorStatement(StateManager ownerSM)
getIteratorStatement
in class AbstractArrayStore
ownerSM
- The StateManager
public ScalarExpression joinElementsTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier listRangeVar, java.lang.Class filteredElementType, ScalarExpression elmExpr, DatastoreIdentifier elementRangeVar)
stmt
- The Query StatementparentStmt
- the parent Query Statement. If there is no parent, parentStmt
must be equals to stmt
ownerMapping
- the mapping for the owner.ownerTe
- Table Expression for the ownerlistRangeVar
- The range variable for the "List" 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.
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 |