示例#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);
    }
  }
示例#2
0
 /** @inheritdoc */
 @Override
 public Long getKey(FiveElements entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
示例#3
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(FiveElements entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }
示例#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));
 }