use of com.intel.mtwilson.as.data.MwCertificateX509 in project OpenAttestation by OpenAttestation.
the class MwCertificateX509JpaController method destroy.
public void destroy(Integer id) throws NonexistentEntityException {
EntityManager em = getEntityManager();
try {
em.getTransaction().begin();
MwCertificateX509 mwCertificateX509;
try {
mwCertificateX509 = em.getReference(MwCertificateX509.class, id);
mwCertificateX509.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The mwCertificateX509 with id " + id + " no longer exists.", enfe);
}
em.remove(mwCertificateX509);
em.getTransaction().commit();
} finally {
em.close();
}
}
use of com.intel.mtwilson.as.data.MwCertificateX509 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 com.intel.mtwilson.as.data.MwCertificateX509 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