@Transactional public class GenericServiceHibernateImpl<T extends DomainObject> extends Object implements GenericService<T>
| Constructor and Description |
|---|
GenericServiceHibernateImpl(Class<T> type)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.hibernate.Criteria |
createCriteria() |
void |
delete(T o) |
void |
detachFromSession(T o) |
List<T> |
findAll() |
protected List<T> |
findByCriteria(org.hibernate.criterion.Criterion... criterion)
Convenience method for subclasses to find domain objects that match the Criterion's
|
protected List<T> |
findByCriteriaOrdered(List<org.hibernate.criterion.Criterion> criterionList,
List<org.hibernate.criterion.Order> orderList)
Convenicence method for subclasses to find domain objects that match the list of Criterion's in the given order
|
List<T> |
findByExample(T exampleInstance) |
List<T> |
findByExample(T exampleInstance,
String[] excludes) |
T |
findById(Long id)
Find by primary key
|
int |
getCount() |
Class<T> |
getPersistentClass() |
protected org.hibernate.classic.Session |
getSession() |
void |
saveOrUpdate(Collection<T> coll) |
Long |
saveOrUpdate(T t) |
public void delete(T o)
delete in interface GenericService<T extends DomainObject>public void detachFromSession(T o)
detachFromSession in interface GenericService<T extends DomainObject>public List<T> findAll()
findAll in interface GenericService<T extends DomainObject>public List<T> findByExample(T exampleInstance)
findByExample in interface GenericService<T extends DomainObject>public List<T> findByExample(T exampleInstance, String[] excludes)
findByExample in interface GenericService<T extends DomainObject>protected List<T> findByCriteria(org.hibernate.criterion.Criterion... criterion)
criterion - array of Criterion'sprotected List<T> findByCriteriaOrdered(List<org.hibernate.criterion.Criterion> criterionList, List<org.hibernate.criterion.Order> orderList)
criterionList - List of Criterion'sorderList - List of Order'spublic T findById(Long id)
GenericServicefindById in interface GenericService<T extends DomainObject>id - the entity primary keypublic int getCount()
getCount in interface GenericService<T extends DomainObject>public Class<T> getPersistentClass()
getPersistentClass in interface GenericService<T extends DomainObject>public Long saveOrUpdate(T t)
saveOrUpdate in interface GenericService<T extends DomainObject>public void saveOrUpdate(Collection<T> coll)
saveOrUpdate in interface GenericService<T extends DomainObject>protected org.hibernate.classic.Session getSession()
public org.hibernate.Criteria createCriteria()
createCriteria in interface GenericService<T extends DomainObject>Copyright © 2009-2012 SURFnet bv, The Netherlands. All Rights Reserved.