Method Summary |
|
void | close() |
public void | deletePersistent(Object obj) Mark the given object for deletion from the persistent store. |
public Collection | getCollectionByQuery(Query query, int lock) Parameters: query - The query to execute Parameters: lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. |
public Collection | getCollectionByQuery(Query query) Parameters: query - The query to execute an Iterator that iterates Objects of class c if calling the .next()method. |
int | getCount(Query query) |
public ClassDescriptor | getDescriptorFor(Class clazz) |
public EditingContext | getEditingContext() Get the EditingContext associated with the transaction to which this connection belongs. |
public Identity | getIdentity(Object object) |
public Iterator | getIteratorByOQLQuery(OQLQuery query) Parameters: query - The OQL query to execute an Iterator that iterates Objects of class c if calling the .next()method. |
public Iterator | getIteratorByOQLQuery(OQLQuery query, int lock) Parameters: query - The OQL query to execute Parameters: lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. |
public Iterator | getIteratorByQuery(Query query) Parameters: query - The query to execute an Iterator that iterates Objects of class c if calling the .next()method. |
public Iterator | getIteratorByQuery(Query query, int lock) Parameters: query - The query to execute Parameters: lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. |
public Object | getObjectByIdentity(Identity oid) Get the object with the given Identity from the persistent store. |
public Object | getObjectByIdentity(Identity oid, int lock) Get the object with the given Identity from the persistent store with the given lock value.
Parameters: oid - the Identity of the object to fetch Parameters: lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. |
public Transaction | getTransaction() |
public void | invalidate(Identity oid) In the case if the program need to change the objects
via direct JDBC call, it should first call invalidate()
for the object, which will lock the object for write
and tell OJB OTM that it must be re-read from the database,
only after that you shold perform JDBC operation. |
public void | invalidateAll() |
boolean | isClosed() |
public void | lockForWrite(Object object) Lock the given object for Write. |
public void | makePersistent(Object object) Make the given object persistent by inserting it into the database. |
public EnhancedOQLQuery | newOQLQuery() returns a new OQL Query. |
public EnhancedOQLQuery | newOQLQuery(int lock) returns a new OQL Query. |
void | refresh(Object object) Updates the values in the object from the data in data store. |
ObjectCache | serviceObjectCache() |
public void | setTransaction(Transaction tx) Associate this connection with a given transaction. |