Search in sources :

Example 1 with JoinType

use of jakarta.persistence.criteria.JoinType in project eclipselink by eclipse-ee4j.

the class QueryTestSuite method testCriteriaGetJoinType.

public void testCriteriaGetJoinType() {
    EntityManager em = createEntityManager();
    CriteriaBuilder qbuilder = em.getCriteriaBuilder();
    CriteriaQuery<Employee> query = qbuilder.createQuery(Employee.class);
    Root<Employee> employee = query.from(Employee.class);
    JoinType jt = employee.join("phoneNumbers", JoinType.LEFT).getJoinType();
    assertEquals("The join type was incorect.", jt, JoinType.LEFT);
}
Also used : CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) EntityManager(jakarta.persistence.EntityManager) Employee(org.eclipse.persistence.testing.models.jpa21.advanced.Employee) JoinType(jakarta.persistence.criteria.JoinType)

Example 2 with JoinType

use of jakarta.persistence.criteria.JoinType in project eclipselink by eclipse-ee4j.

the class QueryTestSuite method testCriteriaGetJoinType.

public void testCriteriaGetJoinType() {
    EntityManager em = createEntityManager();
    CriteriaBuilder qbuilder = em.getCriteriaBuilder();
    CriteriaQuery<Employee> query = qbuilder.createQuery(Employee.class);
    Root<Employee> employee = query.from(Employee.class);
    JoinType jt = employee.join("phoneNumbers", JoinType.LEFT).getJoinType();
    assertEquals("The join type was incorect.", jt, JoinType.LEFT);
}
Also used : CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) EntityManager(jakarta.persistence.EntityManager) Employee(org.eclipse.persistence.testing.models.jpa22.advanced.Employee) JoinType(jakarta.persistence.criteria.JoinType)

Aggregations

EntityManager (jakarta.persistence.EntityManager)2 CriteriaBuilder (jakarta.persistence.criteria.CriteriaBuilder)2 JoinType (jakarta.persistence.criteria.JoinType)2 Employee (org.eclipse.persistence.testing.models.jpa21.advanced.Employee)1 Employee (org.eclipse.persistence.testing.models.jpa22.advanced.Employee)1