Exemple #1
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, CacheControl entity) {
    stmt.clearBindings();

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

    java.util.Date lastUpdate = entity.getLastUpdate();
    if (lastUpdate != null) {
      stmt.bindLong(2, lastUpdate.getTime());
    }
  }
Exemple #2
0
 /** @inheritdoc */
 @Override
 public Long getKey(CacheControl entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Exemple #3
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(CacheControl entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }
Exemple #4
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, CacheControl entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setLastUpdate(
       cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1)));
 }