示例#1
0
文件: UnitDao.java 项目: lecho/campus
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, Unit entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setName(cursor.getString(offset + 1));
   entity.setShortName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
   entity.setFacultyId(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
 }
示例#2
0
文件: UnitDao.java 项目: lecho/campus
  protected Unit loadCurrentDeep(Cursor cursor, boolean lock) {
    Unit entity = loadCurrent(cursor, 0, lock);
    int offset = getAllColumns().length;

    Faculty faculty = loadCurrentOther(daoSession.getFacultyDao(), cursor, offset);
    entity.setFaculty(faculty);

    return entity;
  }
示例#3
0
文件: UnitDao.java 项目: lecho/campus
 /** @inheritdoc */
 @Override
 public Long getKey(Unit entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
示例#4
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);
    }
  }
示例#5
0
文件: UnitDao.java 项目: lecho/campus
 @Override
 protected void attachEntity(Unit entity) {
   super.attachEntity(entity);
   entity.__setDaoSession(daoSession);
 }
示例#6
0
文件: UnitDao.java 项目: lecho/campus
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(Unit entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }