Exemplo n.º 1
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, SqliteMaster entity) {
    stmt.clearBindings();

    String type = entity.getType();
    if (type != null) {
      stmt.bindString(1, type);
    }

    String name = entity.getName();
    if (name != null) {
      stmt.bindString(2, name);
    }

    String tableName = entity.getTableName();
    if (tableName != null) {
      stmt.bindString(3, tableName);
    }

    Long rootpage = entity.getRootpage();
    if (rootpage != null) {
      stmt.bindLong(4, rootpage);
    }

    String sql = entity.getSql();
    if (sql != null) {
      stmt.bindString(5, sql);
    }
  }
Exemplo n.º 2
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, SqliteMaster entity, int offset) {
   entity.setType(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
   entity.setName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
   entity.setTableName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
   entity.setRootpage(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
   entity.setSql(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
 }