Пример #1
0
  public void delete(Class<?> entityType, WhereBuilder whereBuilder) throws DbException {
    if (!tableIsExist(entityType)) return;
    try {
      beginTransaction();

      execNonQuery(SqlInfoBuilder.buildDeleteSqlInfo(this, entityType, whereBuilder));

      setTransactionSuccessful();
    } finally {
      endTransaction();
    }
  }
Пример #2
0
  public void delete(Object entity) throws DbException {
    if (!tableIsExist(entity.getClass())) return;
    try {
      beginTransaction();

      execNonQuery(SqlInfoBuilder.buildDeleteSqlInfo(this, entity));

      setTransactionSuccessful();
    } finally {
      endTransaction();
    }
  }
Пример #3
0
  public void deleteAll(List<?> entities) throws DbException {
    if (entities == null || entities.size() == 0 || !tableIsExist(entities.get(0).getClass()))
      return;
    try {
      beginTransaction();

      for (Object entity : entities) {
        execNonQuery(SqlInfoBuilder.buildDeleteSqlInfo(this, entity));
      }

      setTransactionSuccessful();
    } finally {
      endTransaction();
    }
  }