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

    Long id = entity.getId();
    if (id != null) {
      stmt.bindLong(1, id);
    }
    stmt.bindString(2, entity.getName());
    stmt.bindString(3, entity.getDiscription());
    stmt.bindLong(4, entity.getApplied() ? 1l : 0l);
    stmt.bindLong(5, entity.getEvent_type());

    Long event_id = entity.getEvent_id();
    if (event_id != null) {
      stmt.bindLong(6, event_id);
    }
    stmt.bindLong(7, entity.getPlugin_id());
    stmt.bindLong(8, entity.getGesture_id());
  }