/** * <p>Retrieve a page of entities.</p> * @param pAddParam additional param * @param pFirst number of the first record * @param pPageSize page size (max records) * @return list of business objects * @throws Exception - an exception */ @Override public final List<T> retrievePage(final Map<String, Object> pAddParam, final Integer pFirst, final Integer pPageSize) throws Exception { addAccSettingsIntoAttrs(pAddParam); return getSrvOrm().retrievePage(this.entityClass, pFirst, pPageSize); }
/** * <p>Retrieve entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @return entity or null * @throws Exception - an exception **/ @Override public final T retrieveEntityById(final Map<String, Object> pAddParam, final Object pId) throws Exception { addAccSettingsIntoAttrs(pAddParam); return getSrvOrm().retrieveEntityById(this.entityClass, pId); }
/** * <p>Retrieve a page of entities.</p> * @param pAddParam additional param * @param pQueryConditions Not NULL e.g. "where name='U1' ORDER BY id" * @param pFirst number of the first record * @param pPageSize page size (max records) * @return list of business objects * @throws Exception - an exception */ @Override public final List<T> retrievePageWithConditions( final Map<String, Object> pAddParam, final String pQueryConditions, final Integer pFirst, final Integer pPageSize) throws Exception { addAccSettingsIntoAttrs(pAddParam); return getSrvOrm().retrievePageWithConditions(this.entityClass, pQueryConditions, pFirst, pPageSize); }
/** * <p>Refresh entity from DB by given entity with ID.</p> * @param pEntity entity * @return entity or null * @throws Exception - an exception **/ @Override public final T retrieveEntity(final Map<String, Object> pAddParam, final T pEntity) throws Exception { addAccSettingsIntoAttrs(pAddParam); return getSrvOrm().retrieveEntityById(this.entityClass, pEntity.getItsId()); }
/** * <p>Create entity.</p> * @param pAddParam additional param * @return entity instance * @throws Exception - an exception **/ @Override public final T createEntity( final Map<String, Object> pAddParam) throws Exception { T entity = getSrvOrm().createEntity(this.entityClass); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Retrieve copy of entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @return entity or null * @throws Exception - an exception **/ @Override public final T retrieveCopyEntity(final Map<String, Object> pAddParam, final Object pId) throws Exception { T entity = getSrvOrm().retrieveCopyEntity(this.entityClass, pId); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }