com.ibatis.dao.client.template
Class ToplinkDaoTemplate

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

public abstract class ToplinkDaoTemplate
extends DaoTemplate

A DaoTemplate for Toplink implementations that provides a convenient method to access the Toplink Session.

Version:
$Revision: 152595 $ $Date: 2004-12-28 09:46:14 -0700 (Tue, 28 Dec 2004) $
Author:
Wayne Gentile

Field Summary
 
Fields inherited from class com.ibatis.dao.client.template.DaoTemplate
daoManager
 
Constructor Summary
ToplinkDaoTemplate(DaoManager daoManager)
          The DaoManager that manages this Dao instance will be passed in as the parameter to this constructor automatically upon instantiation.
 
Method Summary
protected  int getCount(java.lang.Class referenceClass, oracle.toplink.expressions.Expression expression)
          Returns a count of the number of objects in a result set given the specified expression.
protected  oracle.toplink.sessions.Session getSession()
          Gets the Toplink session associated with the current DaoTransaction that this Dao is working under.
protected  oracle.toplink.sessions.UnitOfWork getUnitOfWork()
          Gets the Toplink UnitOfWork associated with the current DaoTransaction that this Dao is working under.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToplinkDaoTemplate

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

Parameters:
daoManager - The Dao manager instance for this template
Method Detail

getCount

protected int getCount(java.lang.Class referenceClass,
                       oracle.toplink.expressions.Expression expression)
Returns a count of the number of objects in a result set given the specified expression.

Parameters:
referenceClass - The reference class to use as instances in the result set
expression - The expression to use as a where clause
Returns:
The number of rows returned in the result set after executing the query

getSession

protected oracle.toplink.sessions.Session getSession()
                                              throws DaoException
Gets the Toplink session associated with the current DaoTransaction that this Dao is working under.

Returns:
A Toplink Session instance.
Throws:
DaoException - If a DaoException is thrown

getUnitOfWork

protected oracle.toplink.sessions.UnitOfWork getUnitOfWork()
                                                    throws DaoException
Gets the Toplink UnitOfWork associated with the current DaoTransaction that this Dao is working under.

Returns:
A Toplink UnitOfWork instance.
Throws:
DaoException - If a DaoException is thrown