private SApplicationPage executeGetApplicationPageById(final long applicationPageId) throws SBonitaReadException { return persistenceService .selectById(new SelectByIdDescriptor<SApplicationPage>(SApplicationPage.class, applicationPageId)); }
@Override public SApplication getApplication(final long applicationId) throws SBonitaReadException, SObjectNotFoundException { final SApplication application = persistenceService .selectById(new SelectByIdDescriptor<SApplication>(SApplication.class, applicationId)); if (application == null) { throw new SObjectNotFoundException("No application found with id '" + applicationId + "'."); } return application; }
@Override public SActor getActor(final long actorId) throws SActorNotFoundException, SBonitaReadException { final SelectByIdDescriptor<SActor> selectByIdDescriptor = SelectDescriptorBuilder.getActor(actorId); final SActor actor = persistenceService.selectById(selectByIdDescriptor); if (actor == null) { throw new SActorNotFoundException(actorId + " does not refer to any actor"); } return actor; }
private SActorMember getActorMember(final long actorMemberId) throws SActorMemberNotFoundException, SBonitaReadException { final SelectByIdDescriptor<SActorMember> selectByIdDescriptor = SelectDescriptorBuilder.getActorMember(actorMemberId); final SActorMember actor = persistenceService.selectById(selectByIdDescriptor); if (actor == null) { throw new SActorMemberNotFoundException(actorMemberId + " does not refer to any actor member"); } return actor; }
@Override public SFormMapping get(long formMappingId) throws SBonitaReadException, SObjectNotFoundException { SFormMapping getFormMappingById = persistenceService.selectById(new SelectByIdDescriptor<>(SFormMapping.class, formMappingId)); if (getFormMappingById == null) { throw new SObjectNotFoundException(formMappingId); } return getFormMappingById; }
@Override public SActor getActor(final long actorId) throws SActorNotFoundException, SBonitaReadException { final SelectByIdDescriptor<SActor> selectByIdDescriptor = SelectDescriptorBuilder.getActor(actorId); final SActor actor = persistenceService.selectById(selectByIdDescriptor); if (actor == null) { throw new SActorNotFoundException(actorId + " does not refer to any actor"); } return actor; }
@Override public SLightDocument getDocument(final long documentId) throws SObjectNotFoundException, SBonitaReadException { final SLightDocument document = persistenceService.selectById(new SelectByIdDescriptor<SLightDocument>(SLightDocument.class, documentId)); if (document == null) { throw new SObjectNotFoundException("Document with id " + documentId + " not found"); } return document; }
private SDocument getDocumentWithContent(final Long id) throws SBonitaReadException, SObjectNotFoundException { final SDocument document = persistenceService.selectById(new SelectByIdDescriptor<SDocument>(SDocument.class, id)); if (document == null) { throw new SObjectNotFoundException("Document with id " + id + " not found"); } return document; }
private SDocument getDocumentWithContent(final Long id) throws SBonitaReadException, SObjectNotFoundException { final SDocument document = persistenceService.selectById(new SelectByIdDescriptor<SDocument>(SDocument.class, id)); if (document == null) { throw new SObjectNotFoundException("Document with id " + id + " not found"); } return document; }
@Override public SApplication getApplication(final long applicationId) throws SBonitaReadException, SObjectNotFoundException { final SApplication application = persistenceService .selectById(new SelectByIdDescriptor<SApplication>(SApplication.class, applicationId)); if (application == null) { throw new SObjectNotFoundException("No application found with id '" + applicationId + "'."); } return application; }
@Override public SFormMapping get(long formMappingId) throws SBonitaReadException, SObjectNotFoundException { SFormMapping getFormMappingById = persistenceService.selectById(new SelectByIdDescriptor<>(SFormMapping.class, formMappingId)); if (getFormMappingById == null) { throw new SObjectNotFoundException(formMappingId); } return getFormMappingById; }
@Override public SJobDescriptor getJobDescriptor(final long id) throws SJobDescriptorReadException { try { final SJobDescriptor sJobDescriptor = readPersistenceService.selectById(SelectDescriptorBuilder.getElementById(SJobDescriptor.class, "SJobDescriptor", id)); return sJobDescriptor; } catch (final SBonitaReadException sbre) { throw new SJobDescriptorReadException(sbre); } }
@Override public SUser getUser(final long userId) throws SUserNotFoundException { try { final SUser user = persistenceService.selectById(SelectDescriptorBuilder.getElementById(SUser.class, "User", userId)); if (user == null) { throw new SUserNotFoundException(userId); } return user; } catch (final SBonitaReadException e) { throw new SUserNotFoundException("Cannot get user with id: " + userId, e); } }
@Override public SAComment getArchivedComment(final long archivedCommentId) throws SCommentNotFoundException, SBonitaReadException { final ReadPersistenceService persistenceService = archiveService.getDefinitiveArchiveReadPersistenceService(); final SAComment selectById = persistenceService.selectById(new SelectByIdDescriptor<SAComment>(SAComment.class, archivedCommentId)); if (selectById == null) { throw new SCommentNotFoundException("Archived comment not found with id=" + archivedCommentId); } return selectById; }
@Override public SGroup getGroup(final long groupId) throws SGroupNotFoundException { try { final SGroup group = persistenceService.selectById(SelectDescriptorBuilder.getElementById(SGroup.class, "Group", groupId)); if (group == null) { throw new SGroupNotFoundException("No group exists with id: " + groupId); } return group; } catch (final SBonitaReadException bre) { throw new SGroupNotFoundException(bre); } }
@Override public SUser getUser(final long userId) throws SUserNotFoundException { try { final SUser user = persistenceService.selectById(SelectDescriptorBuilder.getElementById(SUser.class, "User", userId)); if (user == null) { throw new SUserNotFoundException(userId); } return user; } catch (final SBonitaReadException e) { throw new SUserNotFoundException("Cannot get user with id: " + userId, e); } }
@Override public SAMappedDocument getArchivedDocument(final long archivedProcessDocumentId) throws SObjectNotFoundException { try { final SAMappedDocument docMapping = definitiveArchiveReadPersistenceService.selectById(SelectDescriptorBuilder .getArchivedDocumentById(archivedProcessDocumentId)); if (docMapping == null) { throw new SObjectNotFoundException("Document not found with identifier: " + archivedProcessDocumentId); } return docMapping; } catch (final SBonitaReadException e) { throw new SObjectNotFoundException(e); } }
@Override public SProcessInstance getProcessInstance(final long processInstanceId) throws SProcessInstanceReadException, SProcessInstanceNotFoundException { final SProcessInstance instance; try { instance = persistenceRead.selectById(SelectDescriptorBuilder.getElementById(SProcessInstance.class, "ProcessInstance", processInstanceId)); } catch (final SBonitaReadException e) { throw new SProcessInstanceReadException(e); } if (instance == null) { throw new SProcessInstanceNotFoundException(processInstanceId); } return instance; }
@Override public SRole getRole(final long roleId) throws SRoleNotFoundException { try { final SRole selectOne = persistenceService.selectById(SelectDescriptorBuilder.getElementById(SRole.class, "Role", roleId)); if (selectOne == null) { throw new SRoleNotFoundException("The role with id= " + roleId + " does not exist"); } return selectOne; } catch (final SBonitaReadException e) { throw new SRoleNotFoundException(e); } }
@Override public SAComment getArchivedComment(final long archivedCommentId) throws SCommentNotFoundException, SBonitaReadException { final ReadPersistenceService persistenceService = archiveService.getDefinitiveArchiveReadPersistenceService(); final SAComment selectById = persistenceService.selectById(new SelectByIdDescriptor<SAComment>(SAComment.class, archivedCommentId)); if (selectById == null) { throw new SCommentNotFoundException("Archived comment not found with id=" + archivedCommentId); } return selectById; }