use of javax.persistence.criteria.CriteriaQuery in project OpenAttestation by OpenAttestation.
the class TblHostSpecificManifestJpaController method findTblHostSpecificManifestEntities.
private List<TblHostSpecificManifest> findTblHostSpecificManifestEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(TblHostSpecificManifest.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 TblHostSpecificManifestJpaController method getTblHostSpecificManifestCount.
public int getTblHostSpecificManifestCount() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<TblHostSpecificManifest> rt = cq.from(TblHostSpecificManifest.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 TblLocationPcrJpaController method findTblLocationPcrEntities.
private List<TblLocationPcr> findTblLocationPcrEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(TblLocationPcr.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 MwCertificateX509JpaController method findMwCertificateX509Entities.
private List<MwCertificateX509> findMwCertificateX509Entities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(MwCertificateX509.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 MwCertificateX509JpaController method getMwCertificateX509Count.
public int getMwCertificateX509Count() {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
Root<MwCertificateX509> rt = cq.from(MwCertificateX509.class);
cq.select(em.getCriteriaBuilder().count(rt));
Query q = em.createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
Aggregations