protected RelationSource2 loadCurrentDeep(Cursor cursor, boolean lock) {
    RelationSource2 entity = loadCurrent(cursor, 0, lock);
    int offset = getAllColumns().length;

    ToOneTarget2 toOneTarget2 = loadCurrentOther(daoSession.getToOneTarget2Dao(), cursor, offset);
    entity.setToOneTarget2(toOneTarget2);

    return entity;
  }
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, RelationSource2 entity) {
    stmt.clearBindings();

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

    Long toOneId = entity.getToOneId();
    if (toOneId != null) {
      stmt.bindLong(2, toOneId);
    }
  }
 /** @inheritdoc */
 @Override
 public Long getKey(RelationSource2 entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
 @Override
 protected void attachEntity(RelationSource2 entity) {
   super.attachEntity(entity);
   entity.__setDaoSession(daoSession);
 }
 @Override
 protected Long updateKeyAfterInsert(RelationSource2 entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, RelationSource2 entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setToOneId(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1));
 }