gt:                 if (identityScope != null) {
context: package greendao;
  
  import java.util.List;
  import java.util.ArrayList;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteStatement;
  
  import de.greenrobot.dao.AbstractDao;
  import de.greenrobot.dao.Property;
  import de.greenrobot.dao.internal.SqlUtils;
  import de.greenrobot.dao.internal.DaoConfig;
  
  import greendao.ValueSolutionScore;
  
  // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  /** 
   * DAO for table VALUE_SOLUTION_SCORE.
  */
  public class ValueSolutionScoreDao extends AbstractDao<ValueSolutionScore, Long> {
  
      public static final String TABLENAME = "VALUE_SOLUTION_SCORE";
  
      /**
       * Properties of entity ValueSolutionScore.<br/>
       * Can be used for QueryBuilder and for referencing column names.
      */
      public static class Properties {
          public final static Property Id = new Property(0, Long.class, "id", true, "_id");
          public final static Property Score = new Property(1, Double.class, "score", false, "SCORE");
          public final static Property ValueId = new Property(2, Long.class, "valueId", false, "VALUE_ID");
          public final static Property UserId = new Property(3, Long.class, "userId", false, "USER_ID");
          public final static Property SolutionId = new Property(4, Long.class, "solutionId", false, "SOLUTION_ID");
      };
  
      private DaoSession daoSession;
  
  
      public ValueSolutionScoreDao(DaoConfig config) {
          super(config);
      }
      
      public ValueSolutionScoreDao(DaoConfig config, DaoSession daoSession) {
          super(config, daoSession);
          this.daoSession = daoSession;
      }
  
      /** Creates the underlying database table. */
      public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
          String constraint = ifNotExists? "IF NOT EXISTS ": "";
          db.execSQL("CREATE TABLE " + constraint + "'VALUE_SOLUTION_SCORE' (" + //
                  "'_id' INTEGER PRIMARY KEY ," + // 0: id
                  "'SCORE' REAL," + // 1: score
                  "'VALUE_ID' INTEGER," + // 2: valueId
                  "'USER_ID' INTEGER," + // 3: userId
                  "'SOLUTION_ID' INTEGER);"); // 4: solutionId
      }
  
      /** Drops the underlying database table. */
      public static void dropTable(SQLiteDatabase db, boolean ifExists) {
          String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'VALUE_SOLUTION_SCORE'";
          db.execSQL(sql);
      }
  
      /** @inheritdoc */
      @Override
      protected void bindValues(SQLiteStatement stmt, ValueSolutionScore entity) {
          stmt.clearBindings();
   
          Long id = entity.getId();
          if (id != null) {
              stmt.bindLong(1, id);
          }
   
          Double score = entity.getScore();
          if (score != null) {
              stmt.bindDouble(2, score);
          }
   
          Long valueId = entity.getValueId();
          if (valueId != null) {
              stmt.bindLong(3, valueId);
          }
   
          Long userId = entity.getUserId();
          if (userId != null) {
              stmt.bindLong(4, userId);
          }
   
          Long solutionId = entity.getSolutionId();
          if (solutionId != null) {
              stmt.bindLong(5, solutionId);
          }
      }
  
      @Override
      protected void attachEntity(ValueSolutionScore entity) {
          super.attachEntity(entity);
          entity.__setDaoSession(daoSession);
      }
  
      /** @inheritdoc */
      @Override
      public Long readKey(Cursor cursor, int offset) {
          return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
      }    
  
      /** @inheritdoc */
      @Override
      public ValueSolutionScore readEntity(Cursor cursor, int offset) {
          ValueSolutionScore entity = new ValueSolutionScore( //
              cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
              cursor.isNull(offset + 1) ? null : cursor.getDouble(offset + 1), // score
              cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2), // valueId
              cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3), // userId
              cursor.isNull(offset + 4) ? null : cursor.getLong(offset + 4) // solutionId
          );
          return entity;
      }
       
      /** @inheritdoc */
      @Override
      public void readEntity(Cursor cursor, ValueSolutionScore entity, int offset) {
          entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
          entity.setScore(cursor.isNull(offset + 1) ? null : cursor.getDouble(offset + 1));
          entity.setValueId(cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2));
          entity.setUserId(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
          entity.setSolutionId(cursor.isNull(offset + 4) ? null : cursor.getLong(offset + 4));
       }
      
      /** @inheritdoc */
      @Override
      protected Long updateKeyAfterInsert(ValueSolutionScore entity, long rowId) {
          entity.setId(rowId);
          return rowId;
      }
      
      /** @inheritdoc */
      @Override
      public Long getKey(ValueSolutionScore entity) {
          if(entity != null) {
              return entity.getId();
          } else {
              return null;
          }
      }
  
      /** @inheritdoc */
      @Override    
      protected boolean isEntityUpdateable() {
          return true;
      }
      
      private String selectDeep;
  
      protected String getSelectDeep() {
          if (selectDeep == null) {
              StringBuilder builder = new StringBuilder("SELECT ");
              SqlUtils.appendColumns(builder, "T", getAllColumns());
              builder.append(',');
              SqlUtils.appendColumns(builder, "T0", daoSession.getValueDao().getAllColumns());
              builder.append(',');
              SqlUtils.appendColumns(builder, "T1", daoSession.getUserDao().getAllColumns());
              builder.append(',');
              SqlUtils.appendColumns(builder, "T2", daoSession.getSolutionDao().getAllColumns());
              builder.append(" FROM VALUE_SOLUTION_SCORE T");
              builder.append(" LEFT JOIN VALUE T0 ON T.'VALUE_ID'=T0.'_id'");
              builder.append(" LEFT JOIN USER T1 ON T.'USER_ID'=T1.'_id'");
              builder.append(" LEFT JOIN SOLUTION T2 ON T.'SOLUTION_ID'=T2.'_id'");
              builder.append(' ');
              selectDeep = builder.toString();
          }
          return selectDeep;
      }
      
      protected ValueSolutionScore loadCurrentDeep(Cursor cursor, boolean lock) {
          ValueSolutionScore entity = loadCurrent(cursor, 0, lock);
          int offset = getAllColumns().length;
  
          Value value = loadCurrentOther(daoSession.getValueDao(), cursor, offset);
          entity.setValue(value);
          offset += daoSession.getValueDao().getAllColumns().length;
  
          User user = loadCurrentOther(daoSession.getUserDao(), cursor, offset);
          entity.setUser(user);
          offset += daoSession.getUserDao().getAllColumns().length;
  
          Solution solution = loadCurrentOther(daoSession.getSolutionDao(), cursor, offset);
          entity.setSolution(solution);
  
          return entity;    
      }
  
      public ValueSolutionScore loadDeep(Long key) {
          assertSinglePk();
          if (key == null) {
              return null;
          }
  
          StringBuilder builder = new StringBuilder(getSelectDeep());
          builder.append("WHERE ");
          SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
          String sql = builder.toString();
          
          String[] keyArray = new String[] { key.toString() };
          Cursor cursor = db.rawQuery(sql, keyArray);
          
          try {
              boolean available = cursor.moveToFirst();
              if (!available) {
                  return null;
              } else if (!cursor.isLast()) {
                  throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
              }
              return loadCurrentDeep(cursor, true);
          } finally {
              cursor.close();
          }
      }
      
      /** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
      public List<ValueSolutionScore> loadAllDeepFromCursor(Cursor cursor) {
          int count = cursor.getCount();
          List<ValueSolutionScore> list = new ArrayList<ValueSolutionScore>(count);
          
          if (cursor.moveToFirst()) {
              if (identityScope != null) {
                  identityScope.lock();
                  identityScope.reserveRoom(count);
              }
              try {
                  do {
                      list.add(loadCurrentDeep(cursor, false));
                  } while (cursor.moveToNext());
              } finally {
  