|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.portal.dao.hibernate.GenericHibernateDao<T,ID>
public abstract class GenericHibernateDao<T,ID extends Serializable>
Implements the generic CRUD data access operations using Hibernate APIs.
Constructor Summary | |
---|---|
protected |
GenericHibernateDao(Class<T> persistentClass)
Create a new DAO instance for beans of the specified class. |
Method Summary | |
---|---|
void |
delete(T bean,
ITransaction transaction)
Deletes the given bean from persistence. |
protected List<T> |
findByCriteria(ITransaction transaction,
org.hibernate.criterion.Criterion... criterions)
Utility find method for subclasses. |
protected List<T> |
findByCriteria(ITransaction transaction,
org.hibernate.criterion.Criterion[] criterions,
org.hibernate.criterion.Order[] orders)
Utility find method for subclasses. |
T |
get(ID id,
ITransaction transaction)
Returns the bean with the given id. |
protected Class<T> |
getPersistentClass()
Returns the class whose persistence this DAO controls. |
protected org.hibernate.Session |
getSession(ITransaction transaction)
Returns the hibernate session associated with the given transaction. |
void |
persist(T bean,
ITransaction transaction)
Persists a transient bean, making it persistent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected GenericHibernateDao(Class<T> persistentClass)
persistentClass
- the hibernate entity class.Method Detail |
---|
protected Class<T> getPersistentClass()
protected org.hibernate.Session getSession(ITransaction transaction) throws PortalException
transaction
- the transaction.
PortalException
public T get(ID id, ITransaction transaction) throws PortalObjectNotFoundException, PortalException
id
- the bean's id.transaction
- the transaction for persistence access.
PortalObjectNotFoundException
- if the corresponding bean does not exist in the persistence.
PortalException
public void persist(T bean, ITransaction transaction) throws PortalException
bean
- the bean to be made persistent.transaction
- the transaction for persistence access.
PortalException
public void delete(T bean, ITransaction transaction) throws PortalException
bean
- the persistent bean.transaction
- the transaction for persistence access.
PortalException
protected List<T> findByCriteria(ITransaction transaction, org.hibernate.criterion.Criterion[] criterions, org.hibernate.criterion.Order[] orders) throws DaoException
transaction
- transaction for persistence access.criterions
- criterions used to find the result.orders
- specifies the order by which the results will be ordered.
DaoException
protected List<T> findByCriteria(ITransaction transaction, org.hibernate.criterion.Criterion... criterions) throws DaoException
transaction
- transaction for persistence access.criterions
- criterions used to find the result.
DaoException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |