org.directdemocracyportal.democracy.service.dao.hibernate
Class GenericHibernateDAO<T extends BaseEntity,ID extends java.io.Serializable>

Package class diagram package GenericHibernateDAO
java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.directdemocracyportal.democracy.service.dao.hibernate.GenericHibernateDAO<T,ID>
Type Parameters:
T - the generic type
ID - the generic type
All Implemented Interfaces:
GenericDAO<T,ID>, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
HibernateAgentDAO, HibernateCountryDAO, HibernateDocumentDAO, HibernateEventDAO, HibernateGovernmentDAO, HibernatePersonDAO, HibernatePoliticalPartyDAO, HibernatePortalDAO, HibernateRegionDAO, HibernateRoleDAO, HibernateUserDAO, HibernateUserSessionDAO

@Transactional(propagation=MANDATORY)
public abstract class GenericHibernateDAO<T extends BaseEntity,ID extends java.io.Serializable>
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements GenericDAO<T,ID>

The Class GenericHibernateDAO.


Field Summary
Modifier and Type Field and Description
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
Constructor and Description
GenericHibernateDAO(java.lang.Class<T> persistentClass)
          Instantiates a new generic hibernate dao.
 
Method Summary
Modifier and Type Method and Description
 void delete(T entity)
          Delete.
 java.util.List<T> getAll()
          Gets the all.
 T load(ID id)
          Load.
 T save(T entity)
          Save.
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericHibernateDAO

public GenericHibernateDAO(java.lang.Class<T> persistentClass)
Instantiates a new generic hibernate dao.

Parameters:
persistentClass - the persistent class
Method Detail

load

@Transactional(readOnly=true)
public T load(ID id)
                          throws org.springframework.dao.DataAccessException
Description copied from interface: GenericDAO
Load.

Specified by:
load in interface GenericDAO<T extends BaseEntity,ID extends java.io.Serializable>
Parameters:
id - the id
Returns:
the t
Throws:
org.springframework.dao.DataAccessException - the data access exception

save

public T save(T entity)
                          throws org.springframework.dao.DataAccessException
Description copied from interface: GenericDAO
Save.

Specified by:
save in interface GenericDAO<T extends BaseEntity,ID extends java.io.Serializable>
Parameters:
entity - the entity
Returns:
the t
Throws:
org.springframework.dao.DataAccessException - the data access exception

delete

public void delete(T entity)
            throws org.springframework.dao.DataAccessException
Description copied from interface: GenericDAO
Delete.

Specified by:
delete in interface GenericDAO<T extends BaseEntity,ID extends java.io.Serializable>
Parameters:
entity - the entity
Throws:
org.springframework.dao.DataAccessException - the data access exception

getAll

@Transactional(readOnly=true)
public java.util.List<T> getAll()
                                            throws org.springframework.dao.DataAccessException
Description copied from interface: GenericDAO
Gets the all.

Specified by:
getAll in interface GenericDAO<T extends BaseEntity,ID extends java.io.Serializable>
Returns:
the all
Throws:
org.springframework.dao.DataAccessException - the data access exception


Copyright © 2004-2010 www.DirectDemocracyPortal.org. All Rights Reserved.