org.apache.ojb.broker.core
Class PersistenceBrokerBean

java.lang.Object
  extended by org.apache.ojb.broker.core.PersistenceBrokerBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean, PersistenceBroker, org.apache.ojb.broker.util.configuration.Configurable, ObjectContainer

public class PersistenceBrokerBean
extends java.lang.Object
implements PersistenceBroker, javax.ejb.SessionBean

Author:
Matthew Baird The PersistenceBrokerBean wraps a persistenceBroker implementation and allows PersistenceBroker server operations with communication happening over RMI. Useful if you are going to use OJB in a J2EE environment. Allows for OJB objects with proxies to be taken outside of the VM, say to an instance of a servlet container, and the proxies will call back on the bean to materialize proxies via standard RMI bean calls, instead of the custom protocol. Container will be responsible for pooling of bean instances. Can be used by normal EJB clients, not just the PersistenceBrokerClient
See Also:
Serialized Form

Constructor Summary
PersistenceBrokerBean()
           
 
Method Summary
 void abortTransaction()
          Aborts and closes the current transaction.
 void addListener(PBListener listener)
          Adds a temporary PBListener to this broker.
 void addListener(PBListener listener, boolean permanent)
          Adds a temporary or permanent PBListener to this broker, depending on the parameter value.
 void addMtoNImplementor(MtoNImplementor m2nImpl)
          Stores the given m:n implementor int the underlying persistence system.
 void beginTransaction()
          Begins a transaction against the underlying RDBMS.
 void clearCache()
          Clears the broker's internal cache.
 boolean close()
          Closes this broker so that no further requests may be made on it.
 void commitTransaction()
          Commits and closes the current transaction.
 void configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
          configure an object using the Configuration pConfig
 java.lang.Object createProxy(java.lang.Class proxyClass, Identity realSubjectsIdentity)
           
 void delete(java.lang.Object obj)
          Deletes the given object's persistent representation in the underlying persistence system.
 void deleteByQuery(Query query)
          Deletes all objects matching the given query, from the underlying persistence system.
 void deleteMtoNImplementor(MtoNImplementor m2nImpl)
          Deletes an m:n implementor which defines the relationship between two persistent objects.
 void ejbActivate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 void fireBrokerEvent(PBLifeCycleEvent event)
          Fires a life cycle event to inform all registered PBListener instances.
 void fireBrokerEvent(PBStateEvent event)
          Fires a state event to inform all registered PBListener instances.
 void fireBrokerEvent(PersistenceBrokerEvent event)
          Fires a broker event to inform all registered PBListener instances.
 ClassDescriptor getClassDescriptor(java.lang.Class clazz)
          Returns the class descriptor for the given persistence capable class.
 ManageableCollection getCollectionByQuery(java.lang.Class collectionClass, Query query)
          Retrieves the persistent objects matching the given query.
 java.util.Collection getCollectionByQuery(Query query)
          Retrieves the persistent objects matching the given query.
 int getCount(Query query)
          Returns the number of elements that the given query will return.
 DescriptorRepository getDescriptorRepository()
          Returns the metadata descriptor repository associated with this broker.
 java.util.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().
 java.lang.Object getObjectByIdentity(Identity id)
          Retrieve a persistent object from the underlying datastore by its identity.
 java.lang.Object getObjectByQuery(Query query)
          Retrieve the (first) persistent object from the underlying datastore that matches the given query.
 PBKey getPBKey()
          Get the PBKey for this broker.
 java.util.Enumeration getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass, Query query)
          Returns an enumeration of objects representing the primary keys for the objects that match the given query.
 ProxyFactory getProxyFactory()
           
 java.util.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().
 java.lang.Class getTopLevelClass(java.lang.Class clazz)
          Returns the top level class (most abstract class in terms of extents) from which the given class extends.
 boolean hasClassDescriptor(java.lang.Class clazz)
          Determines whether the given class is persistence capable and thus has an associated class descriptor in the metadata.
 boolean isClosed()
          Determines whether this broker is closed.
 boolean isInTransaction()
          Determines whether there is currently a transaction in progress.
 Query query()
          factory method to create a new Query object.
 void removeAllListeners()
          Removes all temporary listeners from this broker.
 void removeAllListeners(boolean permanent)
          Removes all temporary and, if desired, permanent listeners from this broker.
 void removeFromCache(java.lang.Object obj)
          Removes the given object or, if it is an instance of Identity, the object identified by it, from the broker's internal cache.
 void removeListener(PBListener listener)
          Removes the specified listener from this broker.
 void retrieveAllReferences(java.lang.Object pInstance)
          Retrieve all references and collections of the given object irrespective of the metadata settings defined for them.
 void retrieveReference(java.lang.Object pInstance, java.lang.String pAttributeName)
          Retrieve the specified reference or collection attribute for the given persistent object.
 BrokerHelper serviceBrokerHelper()
          Returns the BrokerHelper instance associated with this broker, which makes some additional helper methods available.
 ConnectionManagerIF serviceConnectionManager()
          Returns the ConnectionManagerIF instance associated with this broker.
 IdentityFactory serviceIdentity()
          Return the IdentityFactory instance associated with this broker.
 JdbcAccess serviceJdbcAccess()
          Returns the JdbcAccess instance associated with this broker.
 ObjectCache serviceObjectCache()
          Returns the ObjectCache instance associated with this broker.
 SequenceManager serviceSequenceManager()
          Returns the SequenceManager instance associated with this broker.
 org.apache.ojb.broker.accesslayer.sql.SqlGenerator serviceSqlGenerator()
          Returns the SqlGenerator instance associated with this broker.
 StatementManagerIF serviceStatementManager()
          Returns the StatementManagerIF instance associated with this broker.
 void setSessionContext(javax.ejb.SessionContext sessionContext)
           
 void store(java.lang.Object obj)
          Make the given object persistent in the underlying persistence system.
 void store(java.lang.Object obj, ObjectModification modification)
          Makes the given object persistent in the underlying persistence system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceBrokerBean

public PersistenceBrokerBean()
Method Detail

getDescriptorRepository

public DescriptorRepository getDescriptorRepository()
Description copied from interface: PersistenceBroker
Returns the metadata descriptor repository associated with this broker.

Specified by:
getDescriptorRepository in interface PersistenceBroker
Returns:
The descriptor repository
See Also:
PersistenceBroker.getDescriptorRepository()

getPBKey

public PBKey getPBKey()
Description copied from interface: PersistenceBroker
Get the PBKey for this broker.

Specified by:
getPBKey in interface PersistenceBroker
Returns:
The broker key
See Also:
PersistenceBroker.getPBKey()

delete

public void delete(java.lang.Object obj)
            throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Deletes the given object's persistent representation in the underlying persistence system. This is usually done by issuing a DELETE ... in an RDBMS

Specified by:
delete in interface PersistenceBroker
Parameters:
obj - The object to delete
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.delete(Object)

deleteByQuery

public void deleteByQuery(Query query)
                   throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Deletes all objects matching the given query, from the underlying persistence system. This is usually done via DELETE ... in an RDBMS.
Note: This method directly perform the delete statement ignoring any object references and does not synchronize the cache - take care!

Specified by:
deleteByQuery in interface PersistenceBroker
Parameters:
query - The query determining the objects to delete
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.deleteByQuery(Query)

removeFromCache

public void removeFromCache(java.lang.Object obj)
                     throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Removes the given object or, if it is an instance of Identity, the object identified by it, from the broker's internal cache. Note that the removal is not recursive. This means, objects referenced by the removed object will not be automatically removed from the cache by this operation.

Specified by:
removeFromCache in interface PersistenceBroker
Parameters:
obj - The object to be removed from the cache or its identity
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.removeFromCache(Object)

clearCache

public void clearCache()
                throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Clears the broker's internal cache.

Specified by:
clearCache in interface PersistenceBroker
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.clearCache()

store

public void store(java.lang.Object obj)
           throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Make the given object persistent in the underlying persistence system. This is usually done by issuing an INSERT ... or UPDATE ... in an RDBMS.

Specified by:
store in interface PersistenceBroker
Parameters:
obj - The object to store
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.store(Object)

abortTransaction

public void abortTransaction()
                      throws TransactionNotInProgressException
Description copied from interface: PersistenceBroker
Aborts and closes the current transaction. This abandons all persistent object modifications and releases the associated locks.

Specified by:
abortTransaction in interface PersistenceBroker
Throws:
TransactionNotInProgressException - If no transaction is currently in progress
See Also:
PersistenceBroker.abortTransaction()

beginTransaction

public void beginTransaction()
                      throws TransactionInProgressException,
                             TransactionAbortedException
Description copied from interface: PersistenceBroker
Begins a transaction against the underlying RDBMS.

Specified by:
beginTransaction in interface PersistenceBroker
Throws:
TransactionInProgressException - If there is already a transaction in progress
TransactionAbortedException
See Also:
PersistenceBroker.beginTransaction()

commitTransaction

public void commitTransaction()
                       throws TransactionNotInProgressException,
                              TransactionAbortedException
Description copied from interface: PersistenceBroker
Commits and closes the current transaction. This commits all database-changing statements (e.g. UPDATE, INSERT and DELETE) issued within the transaction since the last commit to the database, and releases any locks held by the transaction.

Specified by:
commitTransaction in interface PersistenceBroker
Throws:
TransactionNotInProgressException - If there is no transaction currently in progress
TransactionAbortedException - If the transaction cannot be committed
See Also:
PersistenceBroker.commitTransaction()

isInTransaction

public boolean isInTransaction()
                        throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Determines whether there is currently a transaction in progress.

Specified by:
isInTransaction in interface PersistenceBroker
Returns:
true if there is a transaction in progress
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.isInTransaction()

close

public boolean close()
Description copied from interface: PersistenceBroker
Closes this broker so that no further requests may be made on it. Closing a broker might release it to the pool of available brokers, or might be garbage collected, at the option of the implementation.

Specified by:
close in interface PersistenceBroker
Returns:
true if the broker was successfully closed
See Also:
PersistenceBroker.close()

isClosed

public boolean isClosed()
Description copied from interface: PersistenceBroker
Determines whether this broker is closed.

Specified by:
isClosed in interface PersistenceBroker
Returns:
true if this instance is closed

getCollectionByQuery

public java.util.Collection getCollectionByQuery(Query query)
                                          throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Retrieves the persistent objects matching the given query. Note that if the Query has no criteria ALL persistent objects of the class targeted by the query will be returned.

Specified by:
getCollectionByQuery in interface PersistenceBroker
Parameters:
query - The query
Returns:
The persistent objects matching the query
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getCollectionByQuery(Query)

getCount

public int getCount(Query query)
             throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Returns the number of elements that the given query will return.

Specified by:
getCount in interface PersistenceBroker
Parameters:
query - The query
Returns:
The number of elements returned by the query
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getCount(Query)

getCollectionByQuery

public ManageableCollection getCollectionByQuery(java.lang.Class collectionClass,
                                                 Query query)
                                          throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Retrieves the persistent objects matching the given query. The resulting collection will be of the supplied collection type. Note that if the Query has no criteria ALL persistent objects of the class targeted by the query will be returned.

Specified by:
getCollectionByQuery in interface PersistenceBroker
Parameters:
collectionClass - The collection type which needs to implement ManageableCollection
query - The query
Returns:
The persistent objects matching the query
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getCollectionByQuery(Class, Query)

getIteratorByQuery

public java.util.Iterator getIteratorByQuery(Query query)
                                      throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
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(). Note that if the Query has no criteria ALL persistent objects of the class targeted by the query will be returned.

Specified by:
getIteratorByQuery in interface PersistenceBroker
Parameters:
query - The query
Returns:
The persistent objects matching the query
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getIteratorByQuery(Query)

getReportQueryIteratorByQuery

public java.util.Iterator getReportQueryIteratorByQuery(Query query)
                                                 throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
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().

Specified by:
getReportQueryIteratorByQuery in interface PersistenceBroker
Parameters:
query - The report query
Returns:
The rows matching the query
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getReportQueryIteratorByQuery(Query)

getObjectByIdentity

public java.lang.Object getObjectByIdentity(Identity id)
                                     throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Retrieve a persistent object from the underlying datastore by its identity. However, users are encouraged to use PersistenceBroker.getObjectByQuery(Query) instead, as this method is mainly intended to be used for internal handling of materialization by OID (e.g. in Proxies).

Specified by:
getObjectByIdentity in interface PersistenceBroker
Parameters:
id - The persistent object's id
Returns:
The persistent object
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getObjectByIdentity(Identity)

getObjectByQuery

public java.lang.Object getObjectByQuery(Query query)
                                  throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Retrieve the (first) persistent object from the underlying datastore that matches the given query.

Specified by:
getObjectByQuery in interface PersistenceBroker
Parameters:
query - The query
Returns:
The persistent object
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getObjectByQuery(Query)

getPKEnumerationByQuery

public java.util.Enumeration getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass,
                                                     Query query)
                                              throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Returns an enumeration of objects representing the primary keys for the objects that match the given query. Mainly useful for EJB Finder Methods.
Note: This method is not yet aware of extents!

Specified by:
getPKEnumerationByQuery in interface PersistenceBroker
Parameters:
PrimaryKeyClass - The class to use for the primary keys
query - The query
Returns:
The pk enumeration
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.getPKEnumerationByQuery(Class, Query)

store

public void store(java.lang.Object obj,
                  ObjectModification modification)
           throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Makes the given object persistent in the underlying persistence system. This is usually done by issuing an INSERT ... or UPDATE ... in an RDBMS.

Specified by:
store in interface PersistenceBroker
Parameters:
obj - The object to store
modification - Specifies what operation to perform (for generating optimized SQL)
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.store(Object, ObjectModification)

getClassDescriptor

public ClassDescriptor getClassDescriptor(java.lang.Class clazz)
                                   throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Returns the class descriptor for the given persistence capable class.

Specified by:
getClassDescriptor in interface PersistenceBroker
Parameters:
clazz - The target class
Returns:
The class descriptor
Throws:
PersistenceBrokerException - If the class is not persistence capable, i.e. if no metadata was defined for this class and hence its class descriptor was not found
See Also:
PersistenceBroker.getClassDescriptor(Class)

hasClassDescriptor

public boolean hasClassDescriptor(java.lang.Class clazz)
Description copied from interface: PersistenceBroker
Determines whether the given class is persistence capable and thus has an associated class descriptor in the metadata.

Specified by:
hasClassDescriptor in interface PersistenceBroker
Parameters:
clazz - The target class
Returns:
true if a class descriptor was found
See Also:
PersistenceBroker.hasClassDescriptor(Class)

getTopLevelClass

public java.lang.Class getTopLevelClass(java.lang.Class clazz)
                                 throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Returns the top level class (most abstract class in terms of extents) from which the given class extends. This may be a (abstract) base-class, an interface or the given class itself, if no extent is defined.

Specified by:
getTopLevelClass in interface PersistenceBroker
Parameters:
clazz - The class to get the top level class for
Returns:
The top level class for it
Throws:
PersistenceBrokerException - If the class is not persistence capable, if no metadata was defined for this class
See Also:
PersistenceBroker.getTopLevelClass(Class)

serviceStatementManager

public StatementManagerIF serviceStatementManager()
Description copied from interface: PersistenceBroker
Returns the StatementManagerIF instance associated with this broker.

Specified by:
serviceStatementManager in interface PersistenceBroker
Returns:
The statement manager
See Also:
PersistenceBroker.serviceStatementManager()

serviceConnectionManager

public ConnectionManagerIF serviceConnectionManager()
Description copied from interface: PersistenceBroker
Returns the ConnectionManagerIF instance associated with this broker.

Specified by:
serviceConnectionManager in interface PersistenceBroker
Returns:
The connection manager
See Also:
PersistenceBroker.serviceConnectionManager()

serviceJdbcAccess

public JdbcAccess serviceJdbcAccess()
Description copied from interface: PersistenceBroker
Returns the JdbcAccess instance associated with this broker.

Specified by:
serviceJdbcAccess in interface PersistenceBroker
Returns:
The JDBC access object

serviceSqlGenerator

public org.apache.ojb.broker.accesslayer.sql.SqlGenerator serviceSqlGenerator()
Description copied from interface: PersistenceBroker
Returns the SqlGenerator instance associated with this broker.

Specified by:
serviceSqlGenerator in interface PersistenceBroker
Returns:
The SQL generator
See Also:
PersistenceBroker.serviceSqlGenerator()

serviceSequenceManager

public SequenceManager serviceSequenceManager()
Description copied from interface: PersistenceBroker
Returns the SequenceManager instance associated with this broker.

Specified by:
serviceSequenceManager in interface PersistenceBroker
Returns:
The sequence manager

serviceBrokerHelper

public BrokerHelper serviceBrokerHelper()
Description copied from interface: PersistenceBroker
Returns the BrokerHelper instance associated with this broker, which makes some additional helper methods available.

Specified by:
serviceBrokerHelper in interface PersistenceBroker
Returns:
The broker helper object

serviceObjectCache

public ObjectCache serviceObjectCache()
Description copied from interface: PersistenceBroker
Returns the ObjectCache instance associated with this broker.

Specified by:
serviceObjectCache in interface PersistenceBroker
Returns:
The object cache

serviceIdentity

public IdentityFactory serviceIdentity()
Description copied from interface: PersistenceBroker
Return the IdentityFactory instance associated with this broker.

Specified by:
serviceIdentity in interface PersistenceBroker
Returns:
The identity factory

fireBrokerEvent

public void fireBrokerEvent(PersistenceBrokerEvent event)
Description copied from interface: PersistenceBroker
Fires a broker event to inform all registered PBListener instances.

Specified by:
fireBrokerEvent in interface PersistenceBroker
Parameters:
event - The event to fire

fireBrokerEvent

public void fireBrokerEvent(PBLifeCycleEvent event)
Description copied from interface: PersistenceBroker
Fires a life cycle event to inform all registered PBListener instances.

Specified by:
fireBrokerEvent in interface PersistenceBroker
Parameters:
event - The event to fire

fireBrokerEvent

public void fireBrokerEvent(PBStateEvent event)
Description copied from interface: PersistenceBroker
Fires a state event to inform all registered PBListener instances.

Specified by:
fireBrokerEvent in interface PersistenceBroker
Parameters:
event - The event to fire

getProxyFactory

public ProxyFactory getProxyFactory()

createProxy

public java.lang.Object createProxy(java.lang.Class proxyClass,
                                    Identity realSubjectsIdentity)

addListener

public void addListener(PBListener listener)
                 throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Adds a temporary PBListener to this broker. Note that temporary listeners will be removed upon closing a broker (returning it to the pool).

Specified by:
addListener in interface PersistenceBroker
Parameters:
listener - The listener to add
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.addListener(PBListener)

addListener

public void addListener(PBListener listener,
                        boolean permanent)
                 throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Adds a temporary or permanent PBListener to this broker, depending on the parameter value. Note that temporary listeners will be removed upon closing a broker (returning it to the pool).
NOTE: Handle carefully when using this method, keep in mind you don't know which broker instance will be returned next time from the pool! To guarantee that a listener is connect to every broker, the best way is to define your own implementation of PersistenceBrokerFactoryIF or extend the default one, PersistenceBrokerFactoryDefaultImpl. There you can add the listener at creation of the PersistenceBroker instances.

Specified by:
addListener in interface PersistenceBroker
Parameters:
listener - The listener to add
permanent - Whether the listener will stay registered after closing the broker
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.addListener(PBListener, boolean)

removeListener

public void removeListener(PBListener listener)
                    throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Removes the specified listener from this broker.

Specified by:
removeListener in interface PersistenceBroker
Parameters:
listener - The listener to remove
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.removeListener(PBListener)

retrieveAllReferences

public void retrieveAllReferences(java.lang.Object pInstance)
                           throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Retrieve all references and collections of the given object irrespective of the metadata settings defined for them.

Specified by:
retrieveAllReferences in interface PersistenceBroker
Parameters:
pInstance - The persistent object
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.retrieveAllReferences(Object)

retrieveReference

public void retrieveReference(java.lang.Object pInstance,
                              java.lang.String pAttributeName)
                       throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Retrieve the specified reference or collection attribute for the given persistent object.

Specified by:
retrieveReference in interface PersistenceBroker
Parameters:
pInstance - The persistent object
pAttributeName - The name of the attribute to retrieve
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.retrieveReference(Object, String)

removeAllListeners

public void removeAllListeners(boolean permanent)
                        throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Removes all temporary and, if desired, permanent listeners from this broker. Use with care, because some internals rely on this mechanism.

Specified by:
removeAllListeners in interface PersistenceBroker
Parameters:
permanent - Whether the listener will stay registered after closing the broker
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.removeListener(PBListener)

removeAllListeners

public void removeAllListeners()
                        throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Removes all temporary listeners from this broker. Use with care, because some internals rely on this mechanism.

Specified by:
removeAllListeners in interface PersistenceBroker
Throws:
PersistenceBrokerException
See Also:
PersistenceBroker.removeAllListeners()

configure

public void configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
               throws org.apache.ojb.broker.util.configuration.ConfigurationException
Description copied from interface: org.apache.ojb.broker.util.configuration.Configurable
configure an object using the Configuration pConfig

Specified by:
configure in interface org.apache.ojb.broker.util.configuration.Configurable
Parameters:
pConfig - the Configuration object used to configure current instance
Throws:
org.apache.ojb.broker.util.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

query

public Query query()
Description copied from interface: ObjectContainer
factory method to create a new Query object.

Specified by:
query in interface ObjectContainer
Returns:
a new Query object
See Also:
ObjectContainer.query()

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
Specified by:
ejbActivate in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      java.rmi.RemoteException
Specified by:
ejbRemove in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
                       throws javax.ejb.EJBException,
                              java.rmi.RemoteException
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

deleteMtoNImplementor

public void deleteMtoNImplementor(MtoNImplementor m2nImpl)
                           throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
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. We try to match one of these collection descriptors, iterating from the left side and looking for possible for classes on the right side using isAssignableFrom(rightClass). TODO: handle cache problems TODO: delete more than one row if possible

Specified by:
deleteMtoNImplementor in interface PersistenceBroker
Parameters:
m2nImpl - The m:n implementor to delete
Throws:
PersistenceBrokerException
See Also:
org.apache.ojb.broker.PersistenceBroker#deleteMtoNImplementor()

addMtoNImplementor

public void addMtoNImplementor(MtoNImplementor m2nImpl)
                        throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Stores the given m:n implementor int the underlying persistence system. This is usually done by inserting a row in an indirection table.
Note that OJB currently doesn't handle collection inheritance, so collections descriptors are written per class. We try to match one of these collection descriptors, iterating from the left side and looking for possible for classes on the right side using isAssignableFrom(rightClass).

Specified by:
addMtoNImplementor in interface PersistenceBroker
Parameters:
m2nImpl - The m:n implementor to delete
Throws:
PersistenceBrokerException
See Also:
org.apache.ojb.broker.PersistenceBroker#addMtoNImplementor()


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30