Beispiel #1
0
  public DbModel findDbModelFirst(DbModelSelector selector) throws DbException {
    if (!tableIsExist(selector.getEntityType())) return null;

    Cursor cursor = execQuery(selector.limit(1).toString());
    if (cursor != null) {
      try {
        if (cursor.moveToNext()) {
          return CursorUtils.getDbModel(cursor);
        }
      } catch (Throwable e) {
        throw new DbException(e);
      } finally {
        IOUtils.closeQuietly(cursor);
      }
    }
    return null;
  }