Search in sources :

Example 91 with ReadAllQuery

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);
    }
}
Also used : Expression(org.eclipse.persistence.expressions.Expression) ReadAllQuery(org.eclipse.persistence.queries.ReadAllQuery)

Example 92 with ReadAllQuery

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);
    }
}
Also used : Expression(org.eclipse.persistence.expressions.Expression) ReadAllQuery(org.eclipse.persistence.queries.ReadAllQuery)

Example 93 with ReadAllQuery

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);
}
Also used : ReadAllQuery(org.eclipse.persistence.queries.ReadAllQuery)

Example 94 with ReadAllQuery

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);
}
Also used : ReadAllQuery(org.eclipse.persistence.queries.ReadAllQuery)

Example 95 with ReadAllQuery

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);
}
Also used : Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) ReadAllQuery(org.eclipse.persistence.queries.ReadAllQuery)

Aggregations

ReadAllQuery (org.eclipse.persistence.queries.ReadAllQuery)440 Expression (org.eclipse.persistence.expressions.Expression)278 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)265 List (java.util.List)202 EntityManager (jakarta.persistence.EntityManager)135 JpaEntityManager (org.eclipse.persistence.jpa.JpaEntityManager)119 Vector (java.util.Vector)112 ArrayList (java.util.ArrayList)88 Spatial (org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.Spatial)82 SpatialParameters (org.eclipse.persistence.expressions.spatial.SpatialParameters)81 Employee (org.eclipse.persistence.testing.models.jpa.advanced.Employee)62 ReportQuery (org.eclipse.persistence.queries.ReportQuery)57 SimpleSpatial (org.eclipse.persistence.testing.models.spatial.jgeometry.SimpleSpatial)47 WrappedSpatial (org.eclipse.persistence.testing.models.spatial.jgeometry.wrapped.WrappedSpatial)44 SQLReader (org.eclipse.persistence.testing.tests.spatial.jgeometry.SQLReader)41 JGeometry (oracle.spatial.geometry.JGeometry)30 CriteriaBuilder (jakarta.persistence.criteria.CriteriaBuilder)29 ReadObjectQuery (org.eclipse.persistence.queries.ReadObjectQuery)28 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)27 Query (jakarta.persistence.Query)25