use of fi.otavanopisto.muikku.plugins.material.model.QuerySelectFieldOption in project muikku by otavanopisto.
the class QuerySelectFieldOptionDAO method create.
public QuerySelectFieldOption create(String name, String text, QuerySelectField field) {
QuerySelectFieldOption querySelectFieldOption = new QuerySelectFieldOption();
querySelectFieldOption.setName(name);
querySelectFieldOption.setText(text);
querySelectFieldOption.setSelectField(field);
return persist(querySelectFieldOption);
}
use of fi.otavanopisto.muikku.plugins.material.model.QuerySelectFieldOption in project muikku by otavanopisto.
the class QuerySelectFieldOptionDAO method listBySelectField.
public List<QuerySelectFieldOption> listBySelectField(QuerySelectField selectField) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<QuerySelectFieldOption> criteria = criteriaBuilder.createQuery(QuerySelectFieldOption.class);
Root<QuerySelectFieldOption> root = criteria.from(QuerySelectFieldOption.class);
criteria.select(root);
criteria.where(criteriaBuilder.equal(root.get(QuerySelectFieldOption_.selectField), selectField));
return entityManager.createQuery(criteria).getResultList();
}
Aggregations