/** * <p>Delete entity with condition, e.g. complex ID.</p> * @param <T> entity type * @param pEntityClass entity class * @param pWhere Not Null e.g. "WAREHOUSESITE=1 and PRODUCT=1" * @throws Exception - an exception **/ @Override public final <T> void deleteEntityWhere( final Class<T> pEntityClass, final String pWhere) throws Exception { if (pWhere == null) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "param_null_not_accepted"); } getSrvDatabase().executeDelete(pEntityClass.getSimpleName() .toUpperCase(), pWhere); }
/** * <p>Delete entity from DB by given NON-COMPLEX ID.</p> * @param <T> entity type * @param pEntityClass entity class * @param pId ID * @throws Exception - an exception **/ @Override public final <T> void deleteEntity( final Class<T> pEntityClass, final Object pId) throws Exception { TableSql tableSql = this.getTablesMap().get(pEntityClass.getSimpleName()); String idStr; if (pId instanceof String) { idStr = "'" + pId.toString() + "'"; } else { idStr = pId.toString(); } getSrvDatabase().executeDelete(pEntityClass.getSimpleName().toUpperCase(), tableSql.getIdName() + "=" + idStr); }
for (int i = classesArr.size() - 1; i >= 0; i--) { Class<?> entityClass = classesArr.get(i); this.srvDatabase.executeDelete(entityClass.getSimpleName() .toUpperCase(), null);
getLogger().info(SrvBalanceStd.class, SrvBalanceStd.class.getSimpleName() + ": deleting all stored balances cause period has changed"); getSrvDatabase().executeDelete(BalanceAt.class.getSimpleName() .toUpperCase(), null); lazyGetBalanceAtAllDirtyCheck().setIsPeriodChanged(false);