use of org.jbei.ice.storage.model.BulkUpload in project ice by JBEI.
the class BulkUploadDAO method getEntryIds.
public List<Long> getEntryIds(BulkUpload upload) {
try {
CriteriaQuery<Long> query = getBuilder().createQuery(Long.class);
Root<BulkUpload> from = query.from(BulkUpload.class);
Join<BulkUpload, Entry> contents = from.join("contents");
query.select(contents.get("id")).where(getBuilder().equal(from.get("id"), upload.getId()));
return currentSession().createQuery(query).list();
} catch (HibernateException e) {
Logger.error(e);
throw new DAOException(e);
}
}
use of org.jbei.ice.storage.model.BulkUpload in project ice by JBEI.
the class BulkUploadDAO method retrieveByStatus.
public List<BulkUpload> retrieveByStatus(BulkUploadStatus status) {
try {
CriteriaQuery<BulkUpload> query = getBuilder().createQuery(BulkUpload.class);
Root<BulkUpload> from = query.from(BulkUpload.class);
query.where(getBuilder().equal(from.get("status"), status));
return currentSession().createQuery(query).list();
} catch (HibernateException he) {
Logger.error(he);
throw new DAOException(he);
}
}
use of org.jbei.ice.storage.model.BulkUpload in project ice by JBEI.
the class BulkEntryCreatorTest method testCreateBulkUpload.
@Test
public void testCreateBulkUpload() throws Exception {
Account account = AccountCreator.createTestAccount("testCreateBulkUpload", false);
long id = creator.createBulkUpload(account.getEmail(), EntryType.PLASMID);
Assert.assertTrue(id > 0);
BulkUpload bulkUpload = DAOFactory.getBulkUploadDAO().get(id);
Assert.assertNotNull(bulkUpload);
Assert.assertEquals(BulkUploadStatus.IN_PROGRESS, bulkUpload.getStatus());
Assert.assertEquals(account.getEmail(), bulkUpload.getAccount().getEmail());
}
Aggregations