public abstract class GenericHibernateDao<T,ID extends Serializable> extends Object
Modifier | Constructor and Description |
---|---|
protected |
GenericHibernateDao(Class<T> persistentClass)
Create a new DAO instance for beans of the specified class.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.