use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialMultiSelectFieldAnswerOption in project muikku by otavanopisto.
the class WorkspaceMaterialMultiSelectFieldAnswerDAO method listByQueryMultiSelectFieldOption.
public List<WorkspaceMaterialMultiSelectFieldAnswer> listByQueryMultiSelectFieldOption(QueryMultiSelectFieldOption option) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<WorkspaceMaterialMultiSelectFieldAnswer> criteria = criteriaBuilder.createQuery(WorkspaceMaterialMultiSelectFieldAnswer.class);
Root<WorkspaceMaterialMultiSelectFieldAnswerOption> root = criteria.from(WorkspaceMaterialMultiSelectFieldAnswerOption.class);
criteria.select(root.get(WorkspaceMaterialMultiSelectFieldAnswerOption_.fieldAnswer)).distinct(true);
criteria.where(criteriaBuilder.equal(root.get(WorkspaceMaterialMultiSelectFieldAnswerOption_.option), option));
return entityManager.createQuery(criteria).getResultList();
}
Aggregations