net.sf.oness.common.model.dao.hibernate
Class HibernateDaoSupport

java.lang.Object
  extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
      extended bynet.sf.oness.common.model.dao.hibernate.HibernateDaoSupport
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
HibernateDao

public class HibernateDaoSupport
extends org.springframework.orm.hibernate.support.HibernateDaoSupport

Class with support for common Hibernate operations. Hibernate DAOs should extend this class.

Version:
$Revision: 1.9 $
Author:
Carlos Sanchez

Field Summary
 
Fields inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
logger
 
Constructor Summary
HibernateDaoSupport()
           
 
Method Summary
protected  java.util.Collection filter(java.util.Collection collection, java.lang.String filter)
          Apply a filter to a persistent collection.
protected  java.util.List findByProperty(java.lang.Class c, java.lang.String propertyName, java.lang.Object value, int firstElement, int maxElements)
          Find objects by property value
protected  java.util.List findByPropertyContent(java.lang.Class c, java.lang.String propertyName, java.lang.String value, int firstElement, int maxElements)
          Find objects by property value where the property contains the value
protected  java.lang.Object loadAndClone(java.lang.Class theClass, java.io.Serializable id)
          Return a clone of the persistent instance with the given identifier, assuming that the instance exists.
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
afterPropertiesSet, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, initDao, setHibernateTemplate, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateDaoSupport

public HibernateDaoSupport()
Method Detail

loadAndClone

protected java.lang.Object loadAndClone(java.lang.Class theClass,
                                        java.io.Serializable id)
Return a clone of the persistent instance with the given identifier, assuming that the instance exists.

Parameters:
theClass - class of the persistent object
id - a valid identifier of an existing persistent instance of the class
Returns:
the cloned object

findByProperty

protected java.util.List findByProperty(java.lang.Class c,
                                        java.lang.String propertyName,
                                        java.lang.Object value,
                                        int firstElement,
                                        int maxElements)
Find objects by property value

Parameters:
c - class of the hibernated object
propertyName - name of the property
value - value to find
firstElement - the first result, numbered from 0
maxElements - the maximum number of results
Returns:

findByPropertyContent

protected java.util.List findByPropertyContent(java.lang.Class c,
                                               java.lang.String propertyName,
                                               java.lang.String value,
                                               int firstElement,
                                               int maxElements)
Find objects by property value where the property contains the value

Parameters:
c - class of the hibernated object
propertyName - name of the property
value - value to find
firstElement - the first result, numbered from 0
maxElements - the maximum number of results
Returns:

filter

protected java.util.Collection filter(java.util.Collection collection,
                                      java.lang.String filter)
Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to this, the collection element. Filters allow efficient access to very large lazy collections. (Executing the filter does not initialize the collection.)

Parameters:
collection - a persistent collection to filter
filter - a filter query string
Returns:
Collection the resulting collection
See Also:
Session.filter()


Copyright © 2003-2005 ONess Project. All Rights Reserved.