use of nikita.common.model.noark5.v4.metadata.CasePartyRole in project nikita-noark5-core by HiOA-ABI.
the class CasePartyRoleService method getCasePartyRoleOrThrow.
/**
* Internal helper method. Rather than having a find and try catch in
* multiple methods, we have it here once. If you call this, be aware
* that you will only ever get a valid CasePartyRole object back. If there
* is no CasePartyRole object, a NoarkEntityNotFoundException exception
* is thrown
*
* @param systemId The systemId of the CasePartyRole object to retrieve
* @return the CasePartyRole object
*/
private CasePartyRole getCasePartyRoleOrThrow(@NotNull String systemId) {
CasePartyRole casePartyRole = casePartyRoleRepository.findBySystemId(systemId);
if (casePartyRole == null) {
String info = INFO_CANNOT_FIND_OBJECT + " CasePartyRole, using " + "systemId " + systemId;
logger.error(info);
throw new NoarkEntityNotFoundException(info);
}
return casePartyRole;
}
use of nikita.common.model.noark5.v4.metadata.CasePartyRole in project nikita-noark5-core by HiOA-ABI.
the class CasePartyRoleService method generateDefaultCasePartyRole.
/**
* Generate a default CasePartyRole object
*
* @return the CasePartyRole object wrapped as a CasePartyRoleHateoas object
*/
@Override
public CasePartyRole generateDefaultCasePartyRole() {
CasePartyRole casePartyRole = new CasePartyRole();
casePartyRole.setCode(TEMPLATE_CASE_PARTY_ROLE_CODE);
casePartyRole.setDescription(TEMPLATE_CASE_PARTY_ROLE_DESCRIPTION);
return casePartyRole;
}
use of nikita.common.model.noark5.v4.metadata.CasePartyRole in project nikita-noark5-core by HiOA-ABI.
the class CasePartyRoleService method findAll.
// All READ operations
/**
* Retrieve a list of all CasePartyRole objects
*
* @return list of CasePartyRole objects wrapped as a
* MetadataHateoas object
*/
@Override
public MetadataHateoas findAll() {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) casePartyRoleRepository.findAll(), CASE_PARTY_ROLE);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
Aggregations