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

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

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

    String name = entity.getName();
    if (name != null) {
      stmt.bindString(3, name);
    }

    String pinyin = entity.getPinyin();
    if (pinyin != null) {
      stmt.bindString(4, pinyin);
    }

    String province = entity.getProvince();
    if (province != null) {
      stmt.bindString(5, province);
    }
  }
예제 #2
0
 /** @inheritdoc */
 @Override
 public Long getKey(Place entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }