use of com.intel.mtwilson.as.data.TblRequestQueue in project OpenAttestation by OpenAttestation.
the class TblRequestQueueJpaControllerTest method testEdit.
@Test
public void testEdit() throws NonexistentEntityException, ASDataException {
TblRequestQueue tblRequestQueue = new TblRequestQueue(RequestQueue_ID);
doReturn(tblRequestQueue).when(tblRequestQueueJpaController).findTblRequestQueue(RequestQueue_ID);
tblRequestQueueJpaController.edit(tblRequestQueue);
verify(em).merge(tblRequestQueue);
verify(em).close();
verify(transaction).begin();
verify(transaction).commit();
}
use of com.intel.mtwilson.as.data.TblRequestQueue in project OpenAttestation by OpenAttestation.
the class TblRequestQueueJpaControllerTest method testDestroy.
@Test
public void testDestroy() throws NonexistentEntityException {
TblRequestQueue tblRequestQueue = new TblRequestQueue(RequestQueue_ID);
doReturn(tblRequestQueue).when(em).getReference(TblRequestQueue.class, RequestQueue_ID);
tblRequestQueueJpaController.destroy(RequestQueue_ID);
verify(em).remove(tblRequestQueue);
verify(em).close();
verify(transaction).begin();
verify(transaction).commit();
}
use of com.intel.mtwilson.as.data.TblRequestQueue in project OpenAttestation by OpenAttestation.
the class TblRequestQueueJpaControllerTest method testCreate.
@Test
public void testCreate() {
TblRequestQueue tblRequestQueue = new TblRequestQueue(RequestQueue_ID);
tblRequestQueueJpaController.create(tblRequestQueue);
verify(em).persist(tblRequestQueue);
verify(em).close();
verify(transaction).begin();
verify(transaction).commit();
}
use of com.intel.mtwilson.as.data.TblRequestQueue in project OpenAttestation by OpenAttestation.
the class TblRequestQueueJpaController method findTblRequestQueueEntities.
private List<TblRequestQueue> findTblRequestQueueEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
cq.select(cq.from(TblRequestQueue.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.TblRequestQueue in project OpenAttestation by OpenAttestation.
the class TblRequestQueueJpaController method destroy.
public void destroy(Integer id) throws NonexistentEntityException {
EntityManager em = getEntityManager();
try {
em.getTransaction().begin();
TblRequestQueue tblRequestQueue;
try {
tblRequestQueue = em.getReference(TblRequestQueue.class, id);
tblRequestQueue.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The tblRequestQueue with id " + id + " no longer exists.", enfe);
}
em.remove(tblRequestQueue);
em.getTransaction().commit();
} finally {
em.close();
}
}
Aggregations