public SystemUserPropertyDTO add(AuthenticationDTO auth, SystemUserPropertyDTO dto) throws ApplicationException { authenticate(auth); if (dto == null) throwException(1); SystemUserProperty entity = session.get(dto.getId()); if (entity != null) throwException(2); entity = SystemUserPropertyUtil.createEntity(dto); return SystemUserPropertyUtil.copy(session.add(entity)); }
public SystemUserPropertyDTO update(AuthenticationDTO auth, SystemUserPropertyDTO dto) throws ApplicationException { authenticate(auth); if (dto == null) throwException(1); SystemUserProperty entity = session.get(dto.getId()); if (entity == null) throwException(3); entity = SystemUserPropertyUtil.update(entity, dto); return SystemUserPropertyUtil.copy(session.update(entity)); }
public SystemUserPropertyDTO get(Integer id) throws ApplicationException { if (SysUtils.isZero(id)) throwException(4); return SystemUserPropertyUtil.copy(session.get(id)); }