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

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