|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ojb.broker.PersistenceBrokerImpl
The PersistenceBrokerClient is an implementation of the PersistenceBroker Interface that specifies a persistence mechanism for generic objects. This Concrete implementation provides an object relational mapping and allows to store and retrieve arbitrary objects in/from relational databases accessed by JDBC.
for a sample application
Constructor Summary | |
PersistenceBrokerImpl(DescriptorRepository repository)
|
Method Summary | |
void |
abortTransaction()
Abort and close the transaction. |
void |
beginTransaction()
begin a transaction against the underlying RDBMS. |
void |
checkPoint()
|
void |
commitTransaction()
Commit and close the transaction. |
void |
delete(java.lang.Object obj)
deletes Object obj's representation in the underlying RDBMS |
ManageableCollection |
getCollectionByQuery(java.lang.Class collectionClass,
Query query)
retrieve a collection of itemClass Objects matching the Query query |
java.util.Collection |
getCollectionByQuery(Query query)
retrieve a collection of itemClass Objects matching the Query query |
ConnectionManager |
getConnectionManager()
|
java.util.Iterator |
getIteratorByQuery(Query query)
returns an Iterator that iterates Objects of class c if calling the .next() method. |
java.lang.Object |
getObjectByIdentity(Identity id)
Method declaration |
java.lang.Object |
getObjectByQuery(Query query)
retrieve an Object by query I.e perform a SELECT ... |
java.util.Enumeration |
getPKEnumerationByQuery(java.lang.Class primaryKeyClass,
Query query)
returns an Enumeration of PrimaryKey Objects for objects of class DataClass. |
StatementManager |
getStatementManager()
|
int |
getUniqueId(java.lang.Class extent,
java.lang.String attribute)
returns a unique int for class extent and field attribute. the returned uid is unique accross all tables in the extent of class extent. |
boolean |
isInTransaction()
returns true if the broker is currently running a transaction. |
void |
removeFromCache(java.lang.Object obj)
removes the objects obj from the brokers internal cache. removing is recursive. |
void |
retrieveCollections(java.lang.Object newObj,
ClassDescriptor mif)
Method declaration |
void |
retrieveReferences(java.lang.Object newObj,
ClassDescriptor mif)
Method declaration |
static void |
setDebug(boolean b)
set the debugging flag to true to enable debugging |
void |
store(java.lang.Object obj)
Method declaration |
void |
store(java.lang.Object obj,
ObjectModification mod)
makes object obj persistent in the underlying persistence system. |
void |
storeImmediate(java.lang.Object obj)
make object obj persistent in the underlying persistence system. this method does not care about transactions. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public PersistenceBrokerImpl(DescriptorRepository repository)
Method Detail |
public static void setDebug(boolean b)
public StatementManager getStatementManager()
public ConnectionManager getConnectionManager()
public void delete(java.lang.Object obj) throws PersistenceBrokerException
delete
in interface PersistenceBroker
public void store(java.lang.Object obj) throws PersistenceBrokerException
store
in interface PersistenceBroker
obj
- PersistenceBrokerException
- public void retrieveReferences(java.lang.Object newObj, ClassDescriptor mif)
newObj
- mif
- public void retrieveCollections(java.lang.Object newObj, ClassDescriptor mif)
newObj
- mif
- public void abortTransaction() throws TransactionNotInProgressException
abortTransaction
in interface PersistenceBroker
public void beginTransaction() throws TransactionInProgressException, TransactionAbortedException
beginTransaction
multiple times,
without an intervening call to commitTransaction
or abortTransaction
,
causes the exception TransactionInProgressException
to be thrown
on the second and subsequent calls.beginTransaction
in interface PersistenceBroker
public void commitTransaction() throws TransactionNotInProgressException, TransactionAbortedException
commit
commits to the database all
UPDATE, INSERT and DELETE statements called within the transaction and
releases any locks held by the transaction.
If beginTransaction() has not been called before a
TransactionNotInProgressException exception is thrown.
If the transaction cannot be commited a TransactionAbortedException exception is thrown.commitTransaction
in interface PersistenceBroker
public void checkPoint() throws TransactionNotInProgressException, TransactionAbortedException
public ManageableCollection getCollectionByQuery(java.lang.Class collectionClass, Query query) throws PersistenceBrokerException
getCollectionByQuery
in interface PersistenceBroker
public java.util.Collection getCollectionByQuery(Query query) throws PersistenceBrokerException
getCollectionByQuery
in interface PersistenceBroker
public java.util.Iterator getIteratorByQuery(Query query) throws PersistenceBrokerException
getIteratorByQuery
in interface PersistenceBroker
public java.lang.Object getObjectByIdentity(Identity id) throws PersistenceBrokerException
getObjectByIdentity
in interface PersistenceBroker
id
- PersistenceBrokerException
- public java.lang.Object getObjectByQuery(Query query) throws PersistenceBrokerException
getObjectByQuery
in interface PersistenceBroker
public java.util.Enumeration getPKEnumerationByQuery(java.lang.Class primaryKeyClass, Query query) throws PersistenceBrokerException
getPKEnumerationByQuery
in interface PersistenceBroker
PrimaryKeyClass
- the pk class for the searched objectsquery
- the querypublic void store(java.lang.Object obj, ObjectModification mod) throws PersistenceBrokerException
store
in interface PersistenceBroker
public boolean isInTransaction()
public int getUniqueId(java.lang.Class extent, java.lang.String attribute)
PersistenceBroker
getUniqueId
in interface PersistenceBroker
public void removeFromCache(java.lang.Object obj) throws PersistenceBrokerException
removeFromCache
in interface PersistenceBroker
public void storeImmediate(java.lang.Object obj) throws PersistenceBrokerException
storeImmediate
in interface PersistenceBroker
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |