EntityManager em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
if (type == ResourceType.EXPERIMENT) {
QueryGenerator generator = new QueryGenerator(EXPERIMENT);
generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
Query q = generator.deleteQuery(em);
q.executeUpdate();
}else {
logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
throw new IllegalArgumentException("Unsupported resource type for project resource.");
}