Method Summary |
|
public void | abortTransaction() Aborts and closes the current transaction. |
public void | addListener(PBListener listener) Adds a temporary
org.apache.ojb.broker.PBListener to this broker. |
public void | addListener(PBListener listener, boolean permanent) Adds a temporary or permanent
org.apache.ojb.broker.PBListener to this broker,
depending on the parameter value. |
public void | addMtoNImplementor(MtoNImplementor m2nImpl) Stores the given m:n implementor int the underlying persistence system. |
public void | beginTransaction() Begins a transaction against the underlying RDBMS. |
public void | clearCache() Clears the broker's internal cache. |
public boolean | close() Closes this broker so that no further requests may be made on it. |
public void | commitTransaction() Commits and closes the current transaction. |
public void | delete(Object obj) Deletes the given object's persistent representation in the underlying persistence system.
This is usually done by issuing a DELETE ... |
public void | deleteByQuery(Query query) Deletes all objects matching the given query, from the underlying persistence system.
This is usually done via DELETE ... |
public void | deleteMtoNImplementor(MtoNImplementor m2nImpl) Deletes an m:n implementor which defines the relationship between two persistent objects.
This is usually a row in an indirection table.
Note that OJB currently doesn't handle collection inheritance, so collections descriptors
are written per class. |
public void | fireBrokerEvent(PersistenceBrokerEvent event) Fires a broker event to inform all registered
PBListener instances. |
public void | fireBrokerEvent(PBLifeCycleEvent event) Fires a life cycle event to inform all registered
PBListener instances. |
public void | fireBrokerEvent(PBStateEvent event) Fires a state event to inform all registered
PBListener instances. |
public ClassDescriptor | getClassDescriptor(Class clazz) Returns the class descriptor for the given persistence capable class. |
public Collection | getCollectionByQuery(Query query) Retrieves the persistent objects matching the given query. |
public ManageableCollection | getCollectionByQuery(Class collectionClass, Query query) Retrieves the persistent objects matching the given query. |
public int | getCount(Query query) Returns the number of elements that the given query will return. |
public DescriptorRepository | getDescriptorRepository() Returns the metadata descriptor repository associated with this broker. |
public Iterator | getIteratorByQuery(Query query) Retrieves the persistent objects matching the given query and returns them as an iterator
which may, depending on the configured collection type, be reloading the objects from
the database upon calling
Iterator.next . |
public Object | getObjectByIdentity(Identity id) Retrieve a persistent object from the underlying datastore by its identity. |
public Object | getObjectByQuery(Query query) Retrieve the (first) persistent object from the underlying datastore that matches the given
query. |
public PBKey | getPBKey() Get the
PBKey for this broker. |
public Enumeration | getPKEnumerationByQuery(Class pkClass, Query query) Returns an enumeration of objects representing the primary keys for the objects that match
the given query. |
public Iterator | getReportQueryIteratorByQuery(Query query) Retrieves the rows (as Object[] instances) matching the given query and
returns them as an iterator which may, depending on the configured collection type, be reloading
the objects from the database upon calling
Iterator.next . |
public Class | getTopLevelClass(Class clazz) Returns the top level class (most abstract class in terms of extents) from which the
given class extends. |
public boolean | hasClassDescriptor(Class clazz) Determines whether the given class is persistence capable and thus has an associated
class descriptor in the metadata. |
public boolean | isClosed() Determines whether this broker is closed. |
public boolean | isInTransaction() Determines whether there is currently a transaction in progress. |
public void | removeAllListeners() Removes all temporary listeners from this broker. |
public void | removeAllListeners(boolean permanent) Removes all temporary and, if desired, permanent listeners from this broker. |
public void | removeFromCache(Object objectOrIdentity) Removes the given object or, if it is an instance of
org.apache.ojb.broker.Identity ,
the object identified by it, from the broker's internal cache. |
public void | removeListener(PBListener listener) Removes the specified listener from this broker. |
public void | retrieveAllReferences(Object obj) Retrieve all references and collections of the given object irrespective of the
metadata settings defined for them. |
public void | retrieveReference(Object obj, String attrName) Retrieve the specified reference or collection attribute for the given persistent object. |
public BrokerHelper | serviceBrokerHelper() Returns the
org.apache.ojb.broker.util.BrokerHelper instance associated with this broker, which
makes some additional helper methods available. |
public ConnectionManagerIF | serviceConnectionManager() Returns the
org.apache.ojb.broker.accesslayer.ConnectionManagerIF instance associated with this broker. |
public IdentityFactory | serviceIdentity() Return the
IdentityFactory instance associated with this broker. |
public JdbcAccess | serviceJdbcAccess() Returns the
org.apache.ojb.broker.accesslayer.JdbcAccess instance associated with this broker. |
public ObjectCache | serviceObjectCache() Returns the
org.apache.ojb.broker.cache.ObjectCache instance associated
with this broker. |
public SequenceManager | serviceSequenceManager() Returns the
org.apache.ojb.broker.util.sequence.SequenceManager instance associated with this broker. |
public SqlGenerator | serviceSqlGenerator() Returns the
org.apache.ojb.broker.accesslayer.sql.SqlGenerator instance associated with this broker. |
public StatementManagerIF | serviceStatementManager() Returns the
org.apache.ojb.broker.accesslayer.StatementManagerIF instance associated with this broker. |
public void | store(Object obj, ObjectModification modification) Makes the given object persistent in the underlying persistence system.
This is usually done by issuing an INSERT ... |
public void | store(Object obj) Make the given object persistent in the underlying persistence system.
This is usually done by issuing an INSERT ... |