use of javax.persistence.criteria.CriteriaQuery in project OpenAttestation by OpenAttestation.
the class TblMleJpaController method getTblMleCount.
public int getTblMleCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<TblMle> rt = cq.from(TblMle.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
use of javax.persistence.criteria.CriteriaQuery in project OpenAttestation by OpenAttestation.
the class TblOsJpaController method findTblOsEntities.
private List<TblOs> findTblOsEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(TblOs.class));
Query q = em.createQuery(cq);
if (!all) {
q.setMaxResults(maxResults);
q.setFirstResult(firstResult);
}
return q.getResultList();
} finally {
em.close();
}
}
use of javax.persistence.criteria.CriteriaQuery in project OpenAttestation by OpenAttestation.
the class TblPackageNamespaceJpaController method getTblPackageNamespaceCount.
public int getTblPackageNamespaceCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<TblPackageNamespace> rt = cq.from(TblPackageNamespace.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
use of javax.persistence.criteria.CriteriaQuery in project OpenAttestation by OpenAttestation.
the class TblPcrManifestJpaController method findTblPcrManifestEntities.
private List<TblPcrManifest> findTblPcrManifestEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(TblPcrManifest.class));
Query q = em.createQuery(cq);
if (!all) {
q.setMaxResults(maxResults);
q.setFirstResult(firstResult);
}
return q.getResultList();
} finally {
em.close();
}
}
use of javax.persistence.criteria.CriteriaQuery in project OpenAttestation by OpenAttestation.
the class TblPcrManifestJpaController method getTblPcrManifestCount.
public int getTblPcrManifestCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<TblPcrManifest> rt = cq.from(TblPcrManifest.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
Aggregations