Example #1
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, Category entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setTitle(cursor.getString(offset + 1));
   entity.setDescription(cursor.getString(offset + 2));
   entity.setImage(cursor.getString(offset + 3));
 }
Example #2
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, Category entity) {
    stmt.clearBindings();

    Long id = entity.getId();
    if (id != null) {
      stmt.bindLong(1, id);
    }
    stmt.bindString(2, entity.getTitle());
    stmt.bindString(3, entity.getDescription());
    stmt.bindString(4, entity.getImage());
  }
Example #3
0
 /** @inheritdoc */
 @Override
 public Long getKey(Category entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Example #4
0
 @Override
 protected void attachEntity(Category entity) {
   super.attachEntity(entity);
   entity.__setDaoSession(daoSession);
 }
Example #5
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(Category entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }