use of fi.otavanopisto.muikku.plugins.material.model.QueryMultiSelectFieldOption in project muikku by otavanopisto.
the class QueryMultiSelectFieldOptionDAO method findByFieldAndName.
public QueryMultiSelectFieldOption findByFieldAndName(QueryMultiSelectField selectField, String name) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<QueryMultiSelectFieldOption> criteria = criteriaBuilder.createQuery(QueryMultiSelectFieldOption.class);
Root<QueryMultiSelectFieldOption> root = criteria.from(QueryMultiSelectFieldOption.class);
criteria.select(root);
criteria.where(criteriaBuilder.and(criteriaBuilder.equal(root.get(QueryMultiSelectFieldOption_.field), selectField), criteriaBuilder.equal(root.get(QueryMultiSelectFieldOption_.name), name)));
return getSingleResult(entityManager.createQuery(criteria));
}
use of fi.otavanopisto.muikku.plugins.material.model.QueryMultiSelectFieldOption in project muikku by otavanopisto.
the class QueryMultiSelectFieldOptionDAO method create.
public QueryMultiSelectFieldOption create(String name, String text, QueryMultiSelectField field) {
QueryMultiSelectFieldOption queryMultiSelectFieldOption = new QueryMultiSelectFieldOption();
queryMultiSelectFieldOption.setName(name);
queryMultiSelectFieldOption.setText(text);
queryMultiSelectFieldOption.setField(field);
return persist(queryMultiSelectFieldOption);
}
Aggregations