Beispiel #1
0
 /** @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));
 }
Beispiel #2
0
  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;
  }
Beispiel #3
0
 /** @inheritdoc */
 @Override
 public Long getKey(Unit entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Beispiel #4
0
  /** @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);
    }
  }
Beispiel #5
0
 @Override
 protected void attachEntity(Unit entity) {
   super.attachEntity(entity);
   entity.__setDaoSession(daoSession);
 }
Beispiel #6
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(Unit entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }