org.zeroexchange.dao
Class BaseHibernateDAO<K extends Serializable,T extends Persistent>

java.lang.Object
  extended by org.zeroexchange.dao.HibernateSessionHolder
      extended by org.zeroexchange.dao.BaseHibernateDAO<K,T>
All Implemented Interfaces:
DAO<K,T>
Direct Known Subclasses:
BaseIntegerPKDAO, BaseStringPKDAO

public abstract class BaseHibernateDAO<K extends Serializable,T extends Persistent>
extends HibernateSessionHolder
implements DAO<K,T>

Author:
black

Constructor Summary
BaseHibernateDAO()
           
 
Method Summary
 T getById(K id)
          Loads entity by id.
protected abstract  Class<T> getEntityClass()
           
 void removeById(K id)
          Removes by id.
 T save(T entity)
          Persists an entity.
 
Methods inherited from class org.zeroexchange.dao.HibernateSessionHolder
getSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseHibernateDAO

public BaseHibernateDAO()
Method Detail

save

public T save(T entity)
Description copied from interface: DAO
Persists an entity.

Specified by:
save in interface DAO<K extends Serializable,T extends Persistent>

getById

public T getById(K id)
Description copied from interface: DAO
Loads entity by id.

Specified by:
getById in interface DAO<K extends Serializable,T extends Persistent>

removeById

public void removeById(K id)
Description copied from interface: DAO
Removes by id.

Specified by:
removeById in interface DAO<K extends Serializable,T extends Persistent>

getEntityClass

protected abstract Class<T> getEntityClass()


Copyright © 2013. All Rights Reserved.