org.itracker.persistence.dao
Class BaseHibernateDAOImpl<T extends Entity>

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.itracker.persistence.dao.BaseHibernateDAOImpl<T>
All Implemented Interfaces:
BaseDAO<T>, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ComponentDAOImpl, ConfigurationDAOImpl, CustomFieldDAOImpl, CustomFieldValueDAOImpl, IssueActivityDAOImpl, IssueAttachmentDAOImpl, IssueDAOImpl, IssueHistoryDAOImpl, IssueRelationDAOImpl, LanguageDAOImpl, NotificationDAOImpl, PermissionDAOImpl, ProjectDAOImpl, ProjectScriptDAOImpl, ReportDAOImpl, UserDAOImpl, UserPreferencesDAOImpl, VersionDAOImpl, WorkflowScriptDAOImpl

public abstract class BaseHibernateDAOImpl<T extends Entity>
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements BaseDAO<T>

Contains common behaviour to all hibernate factories

Author:
rui silva

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
BaseHibernateDAOImpl()
           
 
Method Summary
 void delete(T entity)
          Deletes entity from persistence store.
 void detach(T entity)
          Remove this instance from the session cache.
 T merge(T entity)
          Copy the state of the given object onto the persistent object with the same identifier.
 void refresh(T entity)
          Reloads an entity from persistance.
 void save(T entity)
          insert a new entity.
 void saveOrUpdate(T entity)
          inserts a new detached entity or updates if it already exists.
 
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

BaseHibernateDAOImpl

public BaseHibernateDAOImpl()
Method Detail

save

public void save(T entity)
insert a new entity. create- and lastmodified-date is set with current time.

Specified by:
save in interface BaseDAO<T extends Entity>
Parameters:
entity - - detached entity object
See Also:
Session.save(Object)

saveOrUpdate

public void saveOrUpdate(T entity)
inserts a new detached entity or updates if it already exists. create- and update-date are set automatically.

Specified by:
saveOrUpdate in interface BaseDAO<T extends Entity>
Parameters:
entity - - entity object to be inserted or updated
See Also:
Session.saveOrUpdate(Object)

delete

public void delete(T entity)
Description copied from interface: BaseDAO
Deletes entity from persistence store.

Specified by:
delete in interface BaseDAO<T extends Entity>
See Also:
Session.delete(Object)

detach

public void detach(T entity)
Description copied from interface: BaseDAO
Remove this instance from the session cache.

Specified by:
detach in interface BaseDAO<T extends Entity>
See Also:
Session.evict(Object)

refresh

public void refresh(T entity)
Description copied from interface: BaseDAO
Reloads an entity from persistance.

Specified by:
refresh in interface BaseDAO<T extends Entity>
See Also:
Session.refresh(Object)

merge

public T merge(T entity)
Description copied from interface: BaseDAO
Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded.

Specified by:
merge in interface BaseDAO<T extends Entity>
Returns:
See Also:
Session.merge(Object)


Copyright © 2002-2012 itracker. All Rights Reserved.