use of fi.otavanopisto.muikku.model.users.UserEmailEntity in project muikku by otavanopisto.
the class UserEmailEntityDAO method create.
public UserEmailEntity create(UserSchoolDataIdentifier userSchoolDataIdentifier, String address) {
UserEmailEntity userEmail = new UserEmailEntity();
userEmail.setUserSchoolDataIdentifier(userSchoolDataIdentifier);
userEmail.setAddress(address);
return persist(userEmail);
}
use of fi.otavanopisto.muikku.model.users.UserEmailEntity in project muikku by otavanopisto.
the class UserEmailEntityDAO method listByUserSchoolDataIdentifier.
public List<UserEmailEntity> listByUserSchoolDataIdentifier(UserSchoolDataIdentifier userSchoolDataIdentifier) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<UserEmailEntity> criteria = criteriaBuilder.createQuery(UserEmailEntity.class);
Root<UserEmailEntity> root = criteria.from(UserEmailEntity.class);
criteria.select(root);
criteria.where(criteriaBuilder.equal(root.get(UserEmailEntity_.userSchoolDataIdentifier), userSchoolDataIdentifier));
return entityManager.createQuery(criteria).getResultList();
}
Aggregations