@Modifying @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) public void save(final Roles entity) { if (entity.getId() != null && entity.getUsers().getId() != null && entity.getRole() != null) { this.queryString = QUERY_STRING_SAVE_ROLES_BY_ENTITY; this.values = new Object[] {entity.getId(), entity.getUsers().getId(), entity.getRole()}; super.save(entity); } }
@Modifying @Transactional(readOnly = false, propagation = Propagation.REQUIRED) public Roles update(final Roles entity) { Roles roles = null; if (entity.getId() != null && entity.getUsers().getId() != null && entity.getRole() != null) { this.queryString = QUERY_STRING_UPDATE_ROLES_BY_ENTITY; this.values = new Object[] {entity.getUsers().getId(), entity.getRole(), entity.getId()}; roles = super.update(entity); } return roles; }