|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.scostore.RDBMSPersistableRelationStore
public class RDBMSPersistableRelationStore
RDBMS implementation of a persistable relation backing store. Represents an N-1 unidirectional join table relation, and manages the access to the join table.
| Field Summary | |
|---|---|
protected String |
addStmt
Statement for adding a relation to the join table. |
protected org.datanucleus.ClassLoaderResolver |
clr
ClassLoader resolver. |
protected org.datanucleus.store.mapped.DatastoreAdapter |
dba
Datastore adapter in use by this store. |
protected PersistableJoinTable |
joinTable
Table containing the link between owner and related object. |
protected org.datanucleus.store.mapped.mapping.JavaTypeMapping |
ownerMapping
Mapping to the owner of the relation (which holds the member). |
protected org.datanucleus.metadata.AbstractMemberMetaData |
ownerMemberMetaData
MetaData for the member in the owner. |
protected String |
removeStmt
Statement for removing a relation from the join table. |
protected RDBMSStoreManager |
storeMgr
Manager for the store. |
protected String |
updateStmt
Statement for updating a relation to the join table. |
| Constructor Summary | |
|---|---|
RDBMSPersistableRelationStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
PersistableJoinTable joinTable,
org.datanucleus.ClassLoaderResolver clr)
Constructor for a persistable relation join store for RDBMS. |
|
| Method Summary | |
|---|---|
boolean |
add(org.datanucleus.store.ObjectProvider sm1,
org.datanucleus.store.ObjectProvider sm2)
|
protected String |
getAddStmt()
Generates the statement for adding items. |
protected String |
getRemoveStmt()
Generates the statement for removing items. |
org.datanucleus.store.StoreManager |
getStoreManager()
|
protected String |
getUpdateStmt()
Generates the statement for updating items. |
static int |
populateOwnerInStatement(org.datanucleus.store.ObjectProvider sm,
org.datanucleus.store.ExecutionContext ec,
Object ps,
int jdbcPosition,
PersistableJoinTable joinTable)
Convenience method to populate the passed PreparedStatement with the value from the owner. |
boolean |
remove(org.datanucleus.store.ObjectProvider sm1)
|
boolean |
update(org.datanucleus.store.ObjectProvider sm1,
org.datanucleus.store.ObjectProvider sm2)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RDBMSStoreManager storeMgr
protected org.datanucleus.store.mapped.DatastoreAdapter dba
protected org.datanucleus.store.mapped.mapping.JavaTypeMapping ownerMapping
protected org.datanucleus.metadata.AbstractMemberMetaData ownerMemberMetaData
protected PersistableJoinTable joinTable
protected org.datanucleus.ClassLoaderResolver clr
protected String addStmt
protected String updateStmt
protected String removeStmt
| Constructor Detail |
|---|
public RDBMSPersistableRelationStore(org.datanucleus.metadata.AbstractMemberMetaData mmd,
PersistableJoinTable joinTable,
org.datanucleus.ClassLoaderResolver clr)
mmd - owner member metadatajoinTable - The join tableclr - The ClassLoaderResolver| Method Detail |
|---|
public org.datanucleus.store.StoreManager getStoreManager()
getStoreManager in interface org.datanucleus.store.scostore.Store
public boolean add(org.datanucleus.store.ObjectProvider sm1,
org.datanucleus.store.ObjectProvider sm2)
add in interface org.datanucleus.store.scostore.PersistableRelationStorepublic boolean remove(org.datanucleus.store.ObjectProvider sm1)
remove in interface org.datanucleus.store.scostore.PersistableRelationStore
public boolean update(org.datanucleus.store.ObjectProvider sm1,
org.datanucleus.store.ObjectProvider sm2)
update in interface org.datanucleus.store.scostore.PersistableRelationStoreprotected String getAddStmt()
INSERT INTO JOINTABLE (OWNER_COL, RELATED_COL) VALUES (?,?)
protected String getUpdateStmt()
UPDATE JOINTABLE SET RELATED_COL = ? WHERE OWNER_COL = ?
protected String getRemoveStmt()
DELETE FROM JOINTABLE WHERE OWNER_COL = ?
public static int populateOwnerInStatement(org.datanucleus.store.ObjectProvider sm,
org.datanucleus.store.ExecutionContext ec,
Object ps,
int jdbcPosition,
PersistableJoinTable joinTable)
sm - State Managerec - execution contextps - The PreparedStatementjdbcPosition - Position in JDBC statement to populatejoinTable - Join table
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||