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

    Long id = entity.getId();
    if (id != null) {
      stmt.bindLong(1, id);
    }

    String name = entity.getName();
    if (name != null) {
      stmt.bindString(2, name);
    }
  }
Esempio n. 2
0
 /** @inheritdoc */
 @Override
 public Long getKey(FiveElements entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Esempio n. 3
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(FiveElements entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }
Esempio n. 4
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, FiveElements entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
 }