com.ibatis.dao.client.template
Class OjbBrokerDaoTemplate

java.lang.Object
  extended bycom.ibatis.dao.client.template.DaoTemplate
      extended bycom.ibatis.dao.client.template.OjbBrokerDaoTemplate
All Implemented Interfaces:
Dao

public abstract class OjbBrokerDaoTemplate
extends DaoTemplate

A DaoTemplate for OJB broker implementations that provides a convenient method to access the broker.

This is the base class for OJB DAOs and provides the CRUD pattern necessary methods plus an additional method to retrieve all instances of a given class.


Field Summary
 
Fields inherited from class com.ibatis.dao.client.template.DaoTemplate
daoManager
 
Constructor Summary
OjbBrokerDaoTemplate(DaoManager daoManager)
          The DaoManager that manages this Dao instance will be passed in as the parameter to this constructor automatically upon instantiation.
 
Method Summary
 void create(java.lang.Object vo)
          Puts an instance/value object on the persistentence layer.
 void delete(java.lang.Object vo)
          Removes an instance/value object from the persistence layer.
protected  org.apache.ojb.broker.PersistenceBroker getPersistenceBroker()
          Gets the OJB persistence broker associated with the current DaoTransaction that this Dao is working under.
 java.lang.Object retrieveByPk(java.lang.Object vo)
          Retrieves an instance/value object, according to its primary key,
 java.util.Collection retrieveExtent(java.lang.Class clazz)
          Retrieves all instances of a given class, from the persistence layer.
 void update(java.lang.Object vo)
          Updates the instance/value object representation on the persistence layer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OjbBrokerDaoTemplate

public OjbBrokerDaoTemplate(DaoManager daoManager)
The DaoManager that manages this Dao instance will be passed in as the parameter to this constructor automatically upon instantiation.

Parameters:
daoManager -
Method Detail

create

public final void create(java.lang.Object vo)
Puts an instance/value object on the persistentence layer.

Parameters:
vo - the value object.

retrieveByPk

public final java.lang.Object retrieveByPk(java.lang.Object vo)
Retrieves an instance/value object, according to its primary key,

Parameters:
vo - the value object criteria.
Returns:
the value object.

update

public final void update(java.lang.Object vo)
Updates the instance/value object representation on the persistence layer.

Parameters:
vo - the value object.

delete

public final void delete(java.lang.Object vo)
Removes an instance/value object from the persistence layer.

Parameters:
vo - the value object.

retrieveExtent

public final java.util.Collection retrieveExtent(java.lang.Class clazz)
Retrieves all instances of a given class, from the persistence layer.

Parameters:
clazz - the class of the instances to be fetched.
Returns:
all instances of the given class.

getPersistenceBroker

protected final org.apache.ojb.broker.PersistenceBroker getPersistenceBroker()
Gets the OJB persistence broker associated with the current DaoTransaction that this Dao is working under.

Returns:
A Hibernate Session instance.