public void testTyped() throws QueryException {
    Query q =
        this.qs.newQuery( // must quote "query" because it is a reserved word
            "IMPORT com.gemstone.gemfire.cache.\"query\".data.Portfolio;\n"
                + "SELECT DISTINCT *\n"
                + "FROM /pos TYPE Portfolio\n"
                + "WHERE ID = 3  ");
    Object r = q.execute();
    CacheUtils.getLogger().fine(Utils.printResult(r));

    q =
        this.qs.newQuery( // must quote "query" because it is a reserved word
            "IMPORT com.gemstone.gemfire.cache.\"query\".data.Portfolio;\n"
                + "SELECT DISTINCT *\n"
                + "FROM /pos ptfo TYPE Portfolio\n"
                + "WHERE ID = 3  ");
    r = q.execute();
    CacheUtils.getLogger().fine(Utils.printResult(r));
  }
  public void testTypeCasted() throws QueryException {
    Query q =
        this.qs.newQuery( // must quote "query" because it is a reserved word
            "IMPORT com.gemstone.gemfire.cache.\"query\".data.Portfolio;\n"
                + "SELECT DISTINCT *\n"
                + "FROM (collection<Portfolio>)/pos\n"
                + "WHERE ID = 3  ");
    //
    // com.gemstone.gemfire.internal.util.DebuggerSupport.waitForJavaDebugger(this.cache.getLogger());
    Object r = q.execute();
    CacheUtils.getLogger().fine(Utils.printResult(r));

    q =
        this.qs.newQuery( // must quote "query" because it is a reserved word
            "IMPORT com.gemstone.gemfire.cache.\"query\".data.Position;\n"
                + "SELECT DISTINCT *\n"
                + "FROM /pos p, (collection<Position>)p.positions.values\n"
                + "WHERE secId = 'IBM'");
    //
    // com.gemstone.gemfire.internal.util.DebuggerSupport.waitForJavaDebugger(this.cache.getLogger());
    r = q.execute();
    CacheUtils.getLogger().fine(Utils.printResult(r));
  }