use of fi.otavanopisto.muikku.plugins.communicator.model.CommunicatorMessageIdLabel in project muikku by otavanopisto.
the class CommunicatorController method delete.
public void delete(CommunicatorUserLabel communicatorUserLabel) {
List<CommunicatorMessageIdLabel> labels = communicatorMessageIdLabelDAO.listByLabel(communicatorUserLabel);
for (CommunicatorMessageIdLabel label : labels) {
delete(label);
}
communicatorUserLabelDAO.delete(communicatorUserLabel);
}
use of fi.otavanopisto.muikku.plugins.communicator.model.CommunicatorMessageIdLabel in project muikku by otavanopisto.
the class CommunicatorMessageIdLabelDAO method create.
public CommunicatorMessageIdLabel create(UserEntity userEntity, CommunicatorMessageId messageId, CommunicatorLabel label) {
CommunicatorMessageIdLabel communicatorUserLabel = new CommunicatorMessageIdLabel();
communicatorUserLabel.setUserEntity(userEntity.getId());
communicatorUserLabel.setCommunicatorMessageId(messageId);
communicatorUserLabel.setLabel(label);
getEntityManager().persist(communicatorUserLabel);
return communicatorUserLabel;
}
use of fi.otavanopisto.muikku.plugins.communicator.model.CommunicatorMessageIdLabel in project muikku by otavanopisto.
the class CommunicatorMessageIdLabelDAO method listByLabel.
public List<CommunicatorMessageIdLabel> listByLabel(CommunicatorUserLabel communicatorUserLabel) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<CommunicatorMessageIdLabel> criteria = criteriaBuilder.createQuery(CommunicatorMessageIdLabel.class);
Root<CommunicatorMessageIdLabel> root = criteria.from(CommunicatorMessageIdLabel.class);
criteria.select(root);
criteria.where(criteriaBuilder.equal(root.get(CommunicatorMessageIdLabel_.label), communicatorUserLabel));
return entityManager.createQuery(criteria).getResultList();
}
Aggregations