Exemplo n.º 1
0
 /** @inheritdoc */
 @Override
 public Long getKey(NewsJumpBean entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Exemplo n.º 2
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, NewsJumpBean entity) {
    stmt.clearBindings();

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

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

    String content = entity.getContent();
    if (content != null) {
      stmt.bindString(3, content);
    }
  }
Exemplo n.º 3
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, NewsJumpBean entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setUrl(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
   entity.setContent(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
 }
Exemplo n.º 4
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(NewsJumpBean entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }