Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Couting using criteria query

CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Long> query = cb.createQuery(Long.class);
Root<Employee> root = query.from(Employee.class);
query.select(cq.count(root));

em.createQuery(query).getSingleResult();

--Gordon

Gopi Kandaswamy wrote:
Hi,

Is there a way to implement the following using criteria API

select count(*) from Employee E where ....

Thanks

Gopi
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top