// Query returning the avg of weeklyhours of all employees
Query sub = pm.newQuery(Employee.class);
sub.setResult("avg(this.weeklyhours)");
Query apiQuery = pm.newQuery(Employee.class);
apiQuery.setFilter("this.weeklyhours> averageWeeklyhours");
apiQuery.addSubquery(tmp, "double averageWeeklyhours", null);
// second call of addSubquery using the same variable
// should replace the previous setting, so apiQuery should
// represent the query of singleStringJDOQL
apiQuery.addSubquery(sub, "double averageWeeklyhours", null);
executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL,