|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nci.caarray.services.util.db.ManagerDB
public abstract class ManagerDB
The super class of all ManagerDB classes to allow common OJB operations to be shared.
Field Summary | |
---|---|
protected static int |
CASCADE_LINK
|
protected static int |
CASCADE_NONE
|
protected static int |
CASCADE_OBJECT
|
protected static long |
ID_UNSET
|
Constructor Summary | |
---|---|
protected |
ManagerDB()
Creates a new instance of ManagerDB |
protected |
ManagerDB(java.lang.String profileName)
Creates a new instance of ManagerDB |
Method Summary | |
---|---|
void |
clearCache()
clears the cache Fix for TT13110 |
void |
close()
Close database connection. |
protected long |
countObjects(org.apache.ojb.broker.query.Query query)
Count the number of objects that match the specified Query . |
protected long |
countObjects(org.apache.ojb.broker.query.Query query,
org.apache.ojb.broker.PersistenceBroker broker)
Count the number of objects that match the specified Query . |
protected void |
deleteByQuery(org.apache.ojb.broker.query.Query query)
Delegates to OJB's deleteByQuery which executes a DELETE query. |
protected boolean |
deleteMtoNRelation(java.lang.Object leftObject,
java.lang.Object rightObject,
java.lang.String collectionFieldName)
Deletes a many-to-many association between two objects. |
protected boolean |
deleteObject(java.lang.Class clazz,
java.lang.Object id)
Deletes the object given its class type and ID. |
protected boolean |
deleteObject(java.lang.Object obj)
Deletes an object. |
protected boolean |
deleteObject(java.lang.Object obj,
org.apache.ojb.broker.PersistenceBroker broker)
Deletes an object. |
protected boolean |
deleteObjectByQuery(org.apache.ojb.broker.query.Query query)
Deletes an object by query. |
boolean |
exists(java.lang.Class clazz,
java.lang.Object id)
Check if the specified object that matches the specified ID and is of the specified Class type exists. |
Identifiable |
getIdentifiable(java.lang.Class identifiableClass,
java.lang.String identifier)
|
java.lang.Object |
getObject(java.lang.Class realClazz,
java.lang.Class topLevelClazz,
java.lang.Object id)
Gets an object of the specified class that matches the specified ID. |
protected java.lang.Object |
getObject(java.lang.Class realClazz,
java.lang.Class topLevelClazz,
java.lang.Object id,
org.apache.ojb.broker.PersistenceBroker broker)
Gets an object of the specified class that matches the specified ID. |
java.lang.Object |
getObject(java.lang.Class clazz,
java.lang.Object id)
Gets an object of the specified class that matches the specified ID. |
java.lang.Object |
getObject(java.lang.Class clazz,
java.lang.Object id,
org.apache.ojb.broker.PersistenceBroker broker)
Gets an object of the specified class that matches the specified ID. |
protected java.lang.Object |
getObject(org.apache.ojb.broker.query.Query query)
This method will return a single object that matches the specified query. |
protected java.lang.Object |
getObject(org.apache.ojb.broker.query.Query query,
org.apache.ojb.broker.PersistenceBroker broker)
This method will return a single object that matches the specified query. |
protected java.util.Iterator |
getObjectIterator(org.apache.ojb.broker.query.Query query)
|
protected java.util.Iterator |
getObjectIterator(org.apache.ojb.broker.query.Query query,
org.apache.ojb.broker.PersistenceBroker broker)
This method will return a lazy loading Iterator that
materializes the object that meet the specification of the specified
query each time the next() method is invoked. |
java.lang.Object[] |
getObjects(java.lang.Class clazz)
Retrieve an array of objects of the specified class type. |
protected java.lang.Object[] |
getObjects(org.apache.ojb.broker.query.Query query)
This method will return a collection of objects that meets the specified query. |
protected java.lang.Object[] |
getObjects(org.apache.ojb.broker.query.Query query,
org.apache.ojb.broker.PersistenceBroker broker)
This method will return a collection of objects that meets the specified query. |
protected org.apache.ojb.broker.PersistenceBroker |
getPersistenceBroker()
Gets a PersistenceBroker from the pool for the default profile. |
static int |
getSqlInLimit()
|
protected boolean |
insertMtoNRelation(java.lang.Object leftObject,
java.lang.Object rightObject,
java.lang.String collectionFieldName)
Inserts a many-to-many association between two objects. |
protected boolean |
insertMtoNRelation(java.lang.Object leftObject,
java.lang.Object rightObject,
java.lang.String collectionFieldName,
boolean forceInsertAsNew)
|
protected org.apache.ojb.broker.Identity |
insertObject(java.lang.Object obj)
Inserts an object. |
protected org.apache.ojb.broker.Identity |
insertObject(java.lang.Object obj,
org.apache.ojb.broker.PersistenceBroker broker)
|
void |
link(java.lang.Object pInstance,
boolean insert)
|
void |
link(java.lang.Object pInstance,
java.lang.String attributeName,
boolean insert)
|
void |
removeFromCache(java.lang.Object objectOrIdentity)
|
void |
retrieveReference(java.lang.Object pInstance,
java.lang.String attributeName)
|
void |
retrieveReferences(java.lang.Object pInstance)
|
protected int |
setCascadeDelete(org.apache.ojb.broker.PersistenceBroker broker,
java.lang.Class theClass,
java.lang.String referenceName,
int cascadeValue)
|
protected boolean |
setCascadeRetrieve(org.apache.ojb.broker.PersistenceBroker broker,
java.lang.Class theClass,
java.lang.String referenceName,
boolean cascadeValue)
|
protected int |
setCascadeStore(org.apache.ojb.broker.PersistenceBroker broker,
java.lang.Class theClass,
java.lang.String referenceName,
int cascadeValue)
|
protected org.apache.ojb.broker.Identity |
storeObject(java.lang.Object obj)
Inserts or updates an object. |
protected org.apache.ojb.broker.Identity |
storeObject(java.lang.Object obj,
org.apache.ojb.broker.PersistenceBroker broker)
|
void |
unlink(java.lang.Object pInstance)
|
void |
unlink(java.lang.Object pInstance,
java.lang.String attributeName)
|
protected boolean |
updateObject(java.lang.Object obj)
Updates an object. |
protected boolean |
updateObject(java.lang.Object obj,
org.apache.ojb.broker.PersistenceBroker broker)
Updates an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int CASCADE_OBJECT
protected static final int CASCADE_LINK
protected static final int CASCADE_NONE
protected static final long ID_UNSET
Constructor Detail |
---|
protected ManagerDB()
protected ManagerDB(java.lang.String profileName)
Method Detail |
---|
protected long countObjects(org.apache.ojb.broker.query.Query query)
Query
.
query
- - The query to be matched against
protected long countObjects(org.apache.ojb.broker.query.Query query, org.apache.ojb.broker.PersistenceBroker broker)
Query
.
query
- - The query to be matched against
protected java.lang.Object getObject(org.apache.ojb.broker.query.Query query, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
The
- query to include any criteria for searching an object
of a specific class.
java.lang.Exception
protected java.lang.Object getObject(org.apache.ojb.broker.query.Query query) throws java.lang.Exception
The
- query to include any criteria for searching an object
of a specific class.
java.lang.Exception
protected java.lang.Object[] getObjects(org.apache.ojb.broker.query.Query query) throws java.lang.Exception
query
- - The query to include any criteria for searching objects
of a specific class as a collection
java.lang.Exception
protected java.lang.Object[] getObjects(org.apache.ojb.broker.query.Query query, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
query
- - The query to include any criteria for searching objects
of a specific class as a collection
java.lang.Exception
public java.lang.Object[] getObjects(java.lang.Class clazz) throws java.lang.Exception
clazz
-
DBException
java.lang.Exception
protected java.util.Iterator getObjectIterator(org.apache.ojb.broker.query.Query query, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
Iterator
that
materializes the object that meet the specification of the specified
query each time the next()
method is invoked.
query
- - The query to include any criteria for searching objects
of a specific class as a collection
Iterator
if the result set contains at least
one matched object or null
otherwise.
java.lang.Exception
protected java.util.Iterator getObjectIterator(org.apache.ojb.broker.query.Query query) throws java.lang.Exception
java.lang.Exception
protected boolean updateObject(java.lang.Object obj, org.apache.ojb.broker.PersistenceBroker broker)
obj
- - The object to be updated
protected boolean updateObject(java.lang.Object obj)
obj
- - The object to be updated
protected org.apache.ojb.broker.Identity storeObject(java.lang.Object obj) throws java.lang.Exception
obj
- - The object to be inserted
Identity
object that represents the primary
key of the stored object. If the passed object is null, null is returned.
java.lang.Exception
protected org.apache.ojb.broker.Identity storeObject(java.lang.Object obj, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
java.lang.Exception
protected org.apache.ojb.broker.Identity insertObject(java.lang.Object obj) throws java.lang.Exception
obj
- - The object to be updated
Identity
object that represents the primary
key of the stored object. If the passed object is null, null is returned.
java.lang.Exception
protected org.apache.ojb.broker.Identity insertObject(java.lang.Object obj, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
java.lang.Exception
protected boolean deleteObject(java.lang.Object obj) throws java.lang.Exception
obj
- useTransaction
-
java.lang.Exception
protected boolean deleteObject(java.lang.Object obj, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
obj
- broker
-
java.lang.Exception
protected boolean deleteObjectByQuery(org.apache.ojb.broker.query.Query query) throws java.lang.Exception
query
-
DBException
java.lang.Exception
protected void deleteByQuery(org.apache.ojb.broker.query.Query query) throws java.lang.Exception
query
-
DBException
java.lang.Exception
protected boolean deleteMtoNRelation(java.lang.Object leftObject, java.lang.Object rightObject, java.lang.String collectionFieldName)
leftObject
- rightObject
-
protected boolean insertMtoNRelation(java.lang.Object leftObject, java.lang.Object rightObject, java.lang.String collectionFieldName)
leftObject
- rightObject
- collectionFieldName
-
protected boolean insertMtoNRelation(java.lang.Object leftObject, java.lang.Object rightObject, java.lang.String collectionFieldName, boolean forceInsertAsNew)
protected org.apache.ojb.broker.PersistenceBroker getPersistenceBroker()
public java.lang.Object getObject(java.lang.Class realClazz, java.lang.Class topLevelClazz, java.lang.Object id) throws java.lang.Exception
realClazz
- - The concrete class of the object to be returnedtopLevelClazz
- - The highest persistence-capable class or interface
(in the inheritance hierarchy) that the identified
object is an instance of.id
- - The id of the object.
DBException
java.lang.Exception
public Identifiable getIdentifiable(java.lang.Class identifiableClass, java.lang.String identifier) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object getObject(java.lang.Class realClazz, java.lang.Class topLevelClazz, java.lang.Object id, org.apache.ojb.broker.PersistenceBroker broker) throws java.lang.Exception
realClazz
- - The concrete class of the object to be returnedtopLevelClazz
- - The highest persistence-capable class or interface
(in the inheritance hierarchy) that the identified
object is an instance of.id
- - The id of the object.broker
- - The PersistenceBroker
to be used.
java.lang.Exception
public java.lang.Object getObject(java.lang.Class clazz, java.lang.Object id, org.apache.ojb.broker.PersistenceBroker broker)
QueryByCriteria
to search.
clazz
- id
- public java.lang.Object getObject(java.lang.Class clazz, java.lang.Object id) throws java.lang.Exception
QueryByCriteria
to search.
clazz
- id
-
java.lang.Exception
protected boolean deleteObject(java.lang.Class clazz, java.lang.Object id) throws java.lang.Exception
clazz
- id
-
java.lang.Exception
public boolean exists(java.lang.Class clazz, java.lang.Object id)
Class
type exists.
clazz
- - The Class
type of the object to be searched.id
- - The ID of the object to be searched.
public void removeFromCache(java.lang.Object objectOrIdentity)
public void clearCache()
public void link(java.lang.Object pInstance, boolean insert)
public void link(java.lang.Object pInstance, java.lang.String attributeName, boolean insert)
public void unlink(java.lang.Object pInstance)
public void unlink(java.lang.Object pInstance, java.lang.String attributeName)
public void retrieveReference(java.lang.Object pInstance, java.lang.String attributeName)
public void retrieveReferences(java.lang.Object pInstance)
public void close()
protected boolean setCascadeRetrieve(org.apache.ojb.broker.PersistenceBroker broker, java.lang.Class theClass, java.lang.String referenceName, boolean cascadeValue)
protected int setCascadeStore(org.apache.ojb.broker.PersistenceBroker broker, java.lang.Class theClass, java.lang.String referenceName, int cascadeValue)
protected int setCascadeDelete(org.apache.ojb.broker.PersistenceBroker broker, java.lang.Class theClass, java.lang.String referenceName, int cascadeValue)
public static int getSqlInLimit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |