示例#1
0
文件: UnitDao.java 项目: lecho/campus
 /** @inheritdoc */
 @Override
 public Long getKey(Unit entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
示例#2
0
文件: UnitDao.java 项目: lecho/campus
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, Unit entity) {
    stmt.clearBindings();

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

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

    Long facultyId = entity.getFacultyId();
    if (facultyId != null) {
      stmt.bindLong(4, facultyId);
    }
  }