/** * <p>Calculate total rows for pagination.</p> * @param pAddParam additional param * @param pWhere not null e.g. "ITSID > 33" * @return Integer row count * @throws Exception - an exception */ @Override public final Integer evalRowCountWhere(final Map<String, Object> pAddParam, final String pWhere) throws Exception { return getSrvOrm() .evalRowCountWhere(getEntityClass(), pWhere); }
/** * <p>Retrieve a list of all entities.</p> * @param pAddParam additional param * @return list of all business objects * @throws Exception - an exception */ @Override public final List<T> retrieveList( final Map<String, Object> pAddParam) throws Exception { return getSrvOrm().retrieveList(getEntityClass()); }
/** * <p>Delete entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @throws Exception - an exception **/ @Override public final void deleteEntity(final Map<String, Object> pAddParam, final Object pId) throws Exception { getSrvOrm().deleteEntity(getEntityClass(), pId); }
/** * <p>Calculate total rows for pagination.</p> * @param pAddParam additional param * @param pWhere not null e.g. "ITSID > 33" * @return Integer row count * @throws Exception - an exception */ @Override public final Integer evalRowCount( final Map<String, Object> pAddParam) throws Exception { return getSrvOrm().evalRowCount(getEntityClass()); } /**
/** * <p>Retrieve a list of entities.</p> * @param pAddParam additional param * @param pQueryConditions Not NULL e.g. "where name='U1' ORDER BY id" * @return list of business objects * @throws Exception - an exception */ @Override public final List<T> retrieveListWithConditions( final Map<String, Object> pAddParam, final String pQueryConditions) throws Exception { return getSrvOrm().retrieveListWithConditions( getEntityClass(), pQueryConditions); }
/** * <p>Delete entity from DB.</p> * @param pAddParam additional param * @param pEntity entity * @throws Exception - an exception **/ @Override public final void deleteEntity(final Map<String, Object> pAddParam, final T pEntity) throws Exception { getSrvOrm().deleteEntity(getEntityClass(), pEntity.getItsId()); }
/** * <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( getEntityClass(), pQueryConditions, pFirst, pPageSize); }
/** * <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(getEntityClass(), 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(getEntityClass(), pId); }
/** * <p>Retrieve owned list of entities for owner. * E.g. invoices lines for invoice</p> * @param pAddParam additional param * @param pIdEntityOwner ID owner * @return owned list of business objects * @throws Exception - an exception */ @Override public final List<T> retrieveOwnedListById( final Map<String, Object> pAddParam, final Object pIdEntityOwner) throws Exception { addAccSettingsIntoAttrs(pAddParam); return getSrvOrm().retrieveEntityOwnedlist(getEntityClass(), ReplicationAccMethod.class, pIdEntityOwner); }
/** * <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(getEntityClass(), pId); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <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(getEntityClass(), 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(getEntityClass()); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Retrieve owned list of entities for owner. * E.g. invoices lines for invoice</p> * @param pAddParam additional param * @param pEntityOwner owner * @return owned list of business objects * @throws Exception - an exception */ @Override public final List<T> retrieveOwnedList( final Map<String, Object> pAddParam, final ReplicationAccMethod pEntityOwner) throws Exception { addAccSettingsIntoAttrs(pAddParam); return getSrvOrm().retrieveEntityOwnedlist(getEntityClass(), ReplicationAccMethod.class, pEntityOwner.getItsId()); }
/** * <p>Create entity with its owner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pIdEntityOwner entity owner ID * @return entity instance * @throws Exception - an exception **/ @Override public final T createEntityWithOwnerById( final Map<String, Object> pAddParam, final Object pIdEntityOwner) throws Exception { T entity = getSrvOrm().createEntityWithOwner(getEntityClass(), ReplicationAccMethod.class, pIdEntityOwner); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Create entity with its owner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pEntityOwner owner * @return entity instance * @throws Exception - an exception **/ @Override public final T createEntityWithOwner( final Map<String, Object> pAddParam, final ReplicationAccMethod pEntityOwner) throws Exception { T entity = getSrvOrm() .createEntityWithOwner(getEntityClass(), ReplicationAccMethod.class, pEntityOwner.getItsId()); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }