|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PersistenceBroker declares a protocol for persisting arbitrary objects. A typical implementation might wrap an RDBMS access layer.
PersistenceBrokerClient
Method Summary | |
void |
abortTransaction()
Abort and close the transaction. |
void |
beginTransaction()
begin a transaction against the underlying RDBMS. |
void |
clearCache()
clears the brokers internal cache. |
boolean |
close()
close connection to last opened repository. |
void |
commitTransaction()
Commit and close the transaction. |
void |
delete(java.lang.Object obj)
deletes the objects obj concrete representation in the underlying persistence system. |
ClassDescriptor |
getClassDescriptor(java.lang.Class clazz)
returns a ClassDescriptor for the persistence capable class clazz. |
ManageableCollection |
getCollectionByQuery(java.lang.Class collectionClass,
Query query)
retrieve a userdefined Collection that implements the interface Manageable collection that contains all Objects matching the Query query. |
java.util.Collection |
getCollectionByQuery(Query query)
retrieve a collection of itemClass Objects matching the Query query. |
int |
getCount(Query query)
returns the count of elements a given query will return. |
java.lang.Class |
getExtentClass(java.lang.Class clazz)
returnsthe Extent to which the class clazz belongs. |
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)
retrieve an Object by its Identity. |
java.lang.Object |
getObjectByQuery(Query query)
retrieve an Object by query. |
java.util.Enumeration |
getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass,
Query query)
returns an Enumeration of PrimaryKey Objects for objects of class DataClass. |
java.util.Iterator |
getReportQueryIteratorByQuery(Query query)
returns an Iterator that iterates Object[] calling the .next() method. |
int |
getUniqueId(java.lang.Class extent,
java.lang.String attribute)
returns a unique int for class extent and field attribute. |
long |
getUniqueLong(java.lang.Class extent,
java.lang.String attribute)
returns a unique long for class extent and field attribute. |
java.lang.Object |
getUniqueObject(java.lang.Class extent,
java.lang.String attribute)
returns a unique Object for class extent and field attribute. |
java.lang.String |
getUniqueString(java.lang.Class extent,
java.lang.String attribute)
returns a unique String for class extent and field attribute. |
void |
invalidate(Identity oid)
removes the objects obj from the brokers internal cache and inform other caches in OJB cluster about invalidation. |
boolean |
isInTransaction()
returns true if the broker performs a transaction. |
boolean |
open(java.lang.String repository,
java.lang.String user,
java.lang.String passwd)
open a repository. returns true if successfull, else false. |
void |
removeFromCache(java.lang.Object obj)
removes the objects obj from the brokers internal cache. |
void |
setClassDescriptor(ClassDescriptor modifiedOrNewDescriptor)
adds a new or replaces an existing ClassDescriptor to the DescriptorRepository. |
void |
store(java.lang.Object obj)
make object obj persistent in the underlying persistence system. |
void |
store(java.lang.Object obj,
ObjectModification modification)
makes object obj persistent in the underlying persistence system. |
Method Detail |
public void delete(java.lang.Object obj) throws PersistenceBrokerException
PersistenceBrokerException
public void removeFromCache(java.lang.Object obj) throws PersistenceBrokerException
PersistenceBrokerException
public void invalidate(Identity oid) throws PersistenceBrokerException
PersistenceBrokerException
public void clearCache() throws PersistenceBrokerException
PersistenceBrokerException
public void store(java.lang.Object obj) throws PersistenceBrokerException
PersistenceBrokerException
public void abortTransaction() throws TransactionNotInProgressException
TransactionNotInProgressException
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.
TransactionInProgressException
TransactionAbortedException
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.
TransactionNotInProgressException
TransactionAbortedException
public boolean isInTransaction() throws PersistenceBrokerException
PersistenceBrokerException
public boolean open(java.lang.String repository, java.lang.String user, java.lang.String passwd) throws PersistenceBrokerException
repository
- name of the repositoryuser
- user name, if left null username is taken from repository.passwd
- password, if left null password is taken from repository.
PersistenceBrokerException
public boolean close()
public java.util.Collection getCollectionByQuery(Query query) throws PersistenceBrokerException
PersistenceBrokerException
public int getCount(Query query) throws PersistenceBrokerException
PersistenceBrokerException
public ManageableCollection getCollectionByQuery(java.lang.Class collectionClass, Query query) throws PersistenceBrokerException
PersistenceBrokerException
public java.util.Iterator getIteratorByQuery(Query query) throws PersistenceBrokerException
PersistenceBrokerException
public java.util.Iterator getReportQueryIteratorByQuery(Query query) throws PersistenceBrokerException
PersistenceBrokerException
public java.lang.Object getObjectByIdentity(Identity id) throws PersistenceBrokerException
PersistenceBrokerException
public java.lang.Object getObjectByQuery(Query query) throws PersistenceBrokerException
PersistenceBrokerException
public java.util.Enumeration getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass, Query query) throws PersistenceBrokerException
PrimaryKeyClass
- the pk class for the searched objectsquery
- the query
PersistenceBrokerException
public void store(java.lang.Object obj, ObjectModification modification) throws PersistenceBrokerException
PersistenceBrokerException
public int getUniqueId(java.lang.Class extent, java.lang.String attribute) throws PersistenceBrokerException
PersistenceBrokerException
public long getUniqueLong(java.lang.Class extent, java.lang.String attribute) throws PersistenceBrokerException
PersistenceBrokerException
public java.lang.String getUniqueString(java.lang.Class extent, java.lang.String attribute) throws PersistenceBrokerException
PersistenceBrokerException
public java.lang.Object getUniqueObject(java.lang.Class extent, java.lang.String attribute) throws PersistenceBrokerException
PersistenceBrokerException
public ClassDescriptor getClassDescriptor(java.lang.Class clazz) throws PersistenceBrokerException
PersistenceBrokerException
public void setClassDescriptor(ClassDescriptor modifiedOrNewDescriptor) throws PersistenceBrokerException
PersistenceBrokerException
public java.lang.Class getExtentClass(java.lang.Class clazz) throws PersistenceBrokerException
PersistenceBrokerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |