use of org.eclipse.persistence.queries.ReadAllQuery in project eclipselink by eclipse-ee4j.
the class STI_JoinedAttributeTest method testProblemReporterProjectJoinTeamMembers.
public void testProblemReporterProjectJoinTeamMembers() {
ReadAllQuery query = new ReadAllQuery();
query.setReferenceClass(STI_Project.class);
query.setSelectionCriteria(query.getExpressionBuilder().get("name").equal("Problem Reporter"));
ReadAllQuery controlQuery = (ReadAllQuery) query.clone();
Expression teamMembers = query.getExpressionBuilder().anyOf("teamMembers");
query.addJoinedAttribute(teamMembers);
String errorMsg = executeQueriesAndCompareResults(controlQuery, query);
if (errorMsg.length() > 0) {
failTest(errorMsg);
}
}
use of org.eclipse.persistence.queries.ReadAllQuery in project eclipselink by eclipse-ee4j.
the class STI_JoinedAttributeTest method testEmployeeJoinProjectsJoinTeamLeaderWhereManagerIsNull.
public void testEmployeeJoinProjectsJoinTeamLeaderWhereManagerIsNull() {
ReadAllQuery query = new ReadAllQuery();
query.setReferenceClass(STI_Employee.class);
query.setSelectionCriteria(query.getExpressionBuilder().get("manager").isNull());
ReadAllQuery controlQuery = (ReadAllQuery) query.clone();
Expression projects = query.getExpressionBuilder().anyOf("projects");
query.addJoinedAttribute(projects);
Expression teamLeader = projects.get("teamLeader");
query.addJoinedAttribute(teamLeader);
String errorMsg = executeQueriesAndCompareResults(controlQuery, query);
if (errorMsg.length() > 0) {
failTest(errorMsg);
}
}
use of org.eclipse.persistence.queries.ReadAllQuery in project eclipselink by eclipse-ee4j.
the class ReadAllTest method test.
@Override
public void test() {
ReadAllQuery q = new ReadAllQuery();
q.setReferenceClass(Cubicle.class);
cubicles = (Vector) getSession().executeQuery(q);
}
use of org.eclipse.persistence.queries.ReadAllQuery in project eclipselink by eclipse-ee4j.
the class InheritanceReadAllTest method test.
@Override
public void test() {
ReadAllQuery q = new ReadAllQuery();
q.setReferenceClass(Cubicle.class);
cubicles = (Vector) getSession().executeQuery(q);
}
use of org.eclipse.persistence.queries.ReadAllQuery in project eclipselink by eclipse-ee4j.
the class AddNonFetchedJoinedAttributeTest method setup.
@Override
public void setup() {
getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
query1 = new ReadAllQuery(Employee.class);
employees1 = (Vector) getSession().executeQuery(query1);
}
Aggregations