public class RowCount extends Object implements org.springframework.orm.hibernate5.HibernateCallback<Long>
HibernateTemplate
wrt to DetachedCriteria
this callback should only be executed with native session.Modifier and Type | Method and Description |
---|---|
Long |
doInHibernate(org.hibernate.Session session) |
static long |
execute(org.springframework.orm.hibernate5.HibernateTemplate hibernateTemplate,
Class<?> persistentClass)
Count all entities for a given class
|
static long |
execute(org.springframework.orm.hibernate5.HibernateTemplate hibernateTemplate,
org.hibernate.criterion.DetachedCriteria criteria)
Count all entities for a given criteria
|
public Long doInHibernate(org.hibernate.Session session) throws org.hibernate.HibernateException
doInHibernate
in interface org.springframework.orm.hibernate5.HibernateCallback<Long>
org.hibernate.HibernateException
public static long execute(org.springframework.orm.hibernate5.HibernateTemplate hibernateTemplate, Class<?> persistentClass)
hibernateTemplate
- Hibernate templatepersistentClass
- class for which count query will be runpublic static long execute(org.springframework.orm.hibernate5.HibernateTemplate hibernateTemplate, org.hibernate.criterion.DetachedCriteria criteria)
hibernateTemplate
- Hibernate templatecriteria
- critiera for which count query will be runCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.