public static SelectByIdDescriptor<SCommand> getCommandById(final long commandId) { return new SelectByIdDescriptor<SCommand>(SCommand.class, commandId); } }
@SuppressWarnings("unchecked") <T extends PersistentObject> T selectById(final Session session, final SelectByIdDescriptor<T> selectDescriptor) throws SBonitaReadException { Class<? extends PersistentObject> mappedClass; try { mappedClass = getMappedClass(selectDescriptor.getEntityType()); } catch (final SPersistenceException e) { throw new SBonitaReadException(e); } try { return (T) session.get(mappedClass, selectDescriptor.getId()); } catch (final AssertionFailure | LockAcquisitionException | StaleStateException e) { throw new SRetryableException(e); } catch (final HibernateException he) { throw new SBonitaReadException(he); } }
@Override public <T extends PersistentObject> T selectById(final SelectByIdDescriptor<T> selectDescriptor) throws SBonitaReadException { try { final Session session = getSession(true); final T object = this.selectById(session, selectDescriptor); if (selectDescriptor.isReadOnly()) { disconnectEntityFromSession(session, object); } return object; } catch (final SPersistenceException e) { throw new SBonitaReadException(e, selectDescriptor); } }
@SuppressWarnings("unchecked") <T extends PersistentObject> T selectById(final Session session, final SelectByIdDescriptor<T> selectDescriptor) throws SBonitaReadException { Class<? extends PersistentObject> mappedClass; try { mappedClass = getMappedClass(selectDescriptor.getEntityType()); } catch (final SPersistenceException e) { throw new SBonitaReadException(e); } try { return (T) session.get(mappedClass, selectDescriptor.getId()); } catch (final AssertionFailure | LockAcquisitionException | StaleStateException e) { throw new SRetryableException(e); } catch (final HibernateException he) { throw new SBonitaReadException(he); } }
@Override public <T extends PersistentObject> T selectById(final SelectByIdDescriptor<T> selectDescriptor) throws SBonitaReadException { try { final Session session = getSession(true); final T object = this.selectById(session, selectDescriptor); if (selectDescriptor.isReadOnly()) { disconnectEntityFromSession(session, object); } return object; } catch (final SPersistenceException e) { throw new SBonitaReadException(e, selectDescriptor); } }
public static SelectByIdDescriptor<SCommand> getCommandById(final long commandId) { return new SelectByIdDescriptor<SCommand>(SCommand.class, commandId); } }
@SuppressWarnings("unchecked") @Override <T extends PersistentObject> T selectById(final Session session, final SelectByIdDescriptor<T> selectDescriptor) throws SBonitaReadException { try { final PersistentObjectId id = new PersistentObjectId(selectDescriptor.getId(), getTenantId()); Class<? extends PersistentObject> mappedClass = null; mappedClass = getMappedClass(selectDescriptor.getEntityType()); return (T) session.get(mappedClass, id); } catch (final STenantIdNotSetException e) { return super.selectById(session, selectDescriptor); } catch (final AssertionFailure | LockAcquisitionException | StaleStateException e) { throw new SRetryableException(e); } catch (final SPersistenceException | HibernateException e) { throw new SBonitaReadException(e); } }
public static <T extends PersistentObject> SelectByIdDescriptor<T> getLightElementById(final Class<T> clazz, final String elementName, final long id) { return new SelectByIdDescriptor<T>(clazz, id); }
@SuppressWarnings("unchecked") @Override <T extends PersistentObject> T selectById(final Session session, final SelectByIdDescriptor<T> selectDescriptor) throws SBonitaReadException { try { final PersistentObjectId id = new PersistentObjectId(selectDescriptor.getId(), getTenantId()); Class<? extends PersistentObject> mappedClass = null; mappedClass = getMappedClass(selectDescriptor.getEntityType()); return (T) session.get(mappedClass, id); } catch (final STenantIdNotSetException e) { return super.selectById(session, selectDescriptor); } catch (final AssertionFailure | LockAcquisitionException | StaleStateException e) { throw new SRetryableException(e); } catch (final SPersistenceException | HibernateException e) { throw new SBonitaReadException(e); } }
public static <T extends PersistentObject> SelectByIdDescriptor<T> getLightElementById(final Class<T> clazz, final String elementName, final long id) { return new SelectByIdDescriptor<T>(clazz, id); }
public static SelectByIdDescriptor<SExternalIdentityMapping> getExternalIdentityMappingById(final long mappingId, final String suffix) { return new SelectByIdDescriptor<SExternalIdentityMapping>(SExternalIdentityMapping.class, mappingId); }
public static SelectByIdDescriptor<SProfileMember> getProfileMemberWithoutDisplayName(final long profileMemberId) { return new SelectByIdDescriptor<>(SProfileMember.class, profileMemberId); }
public static SelectByIdDescriptor<SProfileMember> getProfileMemberWithoutDisplayName(final long profileMemberId) { return new SelectByIdDescriptor<>(SProfileMember.class, profileMemberId); }
public static SelectByIdDescriptor<SActorMember> getActorMember(final long actorMemberId) { return new SelectByIdDescriptor<SActorMember>(SActorMember.class, actorMemberId); }
public static SelectByIdDescriptor<SProcessSupervisor> getSupervisor(final long supervisorId) { return new SelectByIdDescriptor<SProcessSupervisor>(SProcessSupervisor.class, supervisorId); }
public static SelectByIdDescriptor<SExternalIdentityMapping> getExternalIdentityMappingById(final long mappingId) { return new SelectByIdDescriptor<SExternalIdentityMapping>(SExternalIdentityMapping.class, mappingId); }
public static SelectByIdDescriptor<SProcessSupervisor> getSupervisor(final long supervisorId) { return new SelectByIdDescriptor<SProcessSupervisor>(SProcessSupervisor.class, supervisorId); }
public static SelectByIdDescriptor<SActor> getActor(final long actorId) { return new SelectByIdDescriptor<SActor>(SActor.class, actorId); }
public static <T extends PersistentObject> SelectByIdDescriptor<T> getElementById(final Class<T> clazz, final String elementName, final long id) { return new SelectByIdDescriptor<T>(clazz, id); }
public static <T extends PersistentObject> SelectByIdDescriptor<T> getElementById(final Class<T> clazz, final long id) { return new SelectByIdDescriptor<>(clazz, id); }