Search in sources :

Example 1 with Join

use of jakarta.persistence.criteria.Join in project hibernate-orm by hibernate.

the class SqmSubQuery method getCorrelatedJoins.

@Override
public Set<Join<?, ?>> getCorrelatedJoins() {
    final Set<Join<?, ?>> correlatedJoins = new HashSet<>();
    final SqmFromClause fromClause = getQuerySpec().getFromClause();
    if (fromClause == null) {
        return correlatedJoins;
    }
    for (SqmRoot<?> root : fromClause.getRoots()) {
        if (root instanceof SqmCorrelation<?, ?>) {
            for (SqmJoin<?, ?> sqmJoin : root.getSqmJoins()) {
                if (sqmJoin instanceof SqmCorrelation<?, ?> && sqmJoin instanceof Join<?, ?>) {
                    correlatedJoins.add((Join<?, ?>) sqmJoin);
                }
            }
        }
    }
    return correlatedJoins;
}
Also used : SqmCorrelation(org.hibernate.query.sqm.tree.domain.SqmCorrelation) SqmAttributeJoin(org.hibernate.query.sqm.tree.from.SqmAttributeJoin) SqmCorrelatedMapJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedMapJoin) SqmEntityJoin(org.hibernate.query.sqm.tree.from.SqmEntityJoin) CollectionJoin(jakarta.persistence.criteria.CollectionJoin) SqmCorrelatedSetJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedSetJoin) SqmMapJoin(org.hibernate.query.sqm.tree.domain.SqmMapJoin) SqmSingularJoin(org.hibernate.query.sqm.tree.domain.SqmSingularJoin) SetJoin(jakarta.persistence.criteria.SetJoin) MapJoin(jakarta.persistence.criteria.MapJoin) SqmJoin(org.hibernate.query.sqm.tree.from.SqmJoin) SqmCorrelatedBagJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedBagJoin) SqmCorrelatedSingularJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedSingularJoin) SqmCrossJoin(org.hibernate.query.sqm.tree.from.SqmCrossJoin) SqmCorrelatedListJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedListJoin) PluralJoin(jakarta.persistence.criteria.PluralJoin) SqmListJoin(org.hibernate.query.sqm.tree.domain.SqmListJoin) SqmSetJoin(org.hibernate.query.sqm.tree.domain.SqmSetJoin) ListJoin(jakarta.persistence.criteria.ListJoin) SqmCorrelatedEntityJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedEntityJoin) SqmBagJoin(org.hibernate.query.sqm.tree.domain.SqmBagJoin) SqmCorrelatedCrossJoin(org.hibernate.query.sqm.tree.domain.SqmCorrelatedCrossJoin) Join(jakarta.persistence.criteria.Join) SqmFromClause(org.hibernate.query.sqm.tree.from.SqmFromClause) HashSet(java.util.HashSet)

Example 2 with Join

use of jakarta.persistence.criteria.Join in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testAliasToEntityMapNoProjectionNullAndNonNullAliasList.

@Test
public void testAliasToEntityMapNoProjectionNullAndNonNullAliasList(SessionFactoryScope scope) throws Exception {
    CriteriaExecutor criteriaExecutor = new CriteriaExecutor() {

        @Override
        protected JpaCriteriaQuery getCriteria(Session s) {
            final CriteriaBuilder builder = s.getSessionFactory().getCriteriaBuilder();
            final JpaCriteriaQuery<Student> criteria = (JpaCriteriaQuery<Student>) builder.createQuery(Student.class);
            final Root<Student> studentRoot = criteria.from(Student.class);
            studentRoot.alias("s");
            studentRoot.join("addresses", JoinType.LEFT).alias("a");
            studentRoot.join("preferredCourse", JoinType.INNER);
            criteria.orderBy(builder.asc(studentRoot.get("studentNumber")));
            return criteria;
        // return s.createCriteria( Student.class, "s" )
        // .createAlias( "s.addresses", "a", CriteriaSpecification.LEFT_JOIN )
        // .setResultTransformer( CriteriaSpecification.ALIAS_TO_ENTITY_MAP )
        // .createCriteria( "s.preferredCourse", CriteriaSpecification.INNER_JOIN )
        // .addOrder( Order.asc( "s.studentNumber") );
        }
    };
    HqlExecutor hqlExecutor = new HqlExecutor() {

        @Override
        public Query getQuery(Session s) {
            return s.createQuery("from Student s left join s.addresses a left join s.preferredCourse order by s.studentNumber").setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        Map yogiMap1 = (Map) resultList.get(0);
        assertEquals(2, yogiMap1.size());
        Map yogiMap2 = (Map) resultList.get(1);
        assertEquals(2, yogiMap2.size());
        assertEquals(yogiExpected, yogiMap1.get("s"));
        Address yogiAddress1 = (Address) yogiMap1.get("a");
        assertEquals(yogiExpected.getAddresses().get(yogiAddress1.getAddressType()), yogiMap1.get("a"));
        assertEquals(yogiExpected, yogiMap2.get("s"));
        Address yogiAddress2 = (Address) yogiMap2.get("a");
        assertEquals(yogiExpected.getAddresses().get(yogiAddress2.getAddressType()), yogiMap2.get("a"));
        assertSame(yogiMap1.get("s"), yogiMap2.get("s"));
        assertNotEquals(yogiAddress1.getAddressType(), yogiAddress2.getAddressType());
    };
    runTest(hqlExecutor, criteriaExecutor, checker, false, scope);
}
Also used : CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) BasicTypeImpl(org.hibernate.type.internal.BasicTypeImpl) ServiceRegistry(org.hibernate.testing.orm.junit.ServiceRegistry) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) JoinType(jakarta.persistence.criteria.JoinType) JpaSelection(org.hibernate.query.criteria.JpaSelection) AvailableSettings(org.hibernate.cfg.AvailableSettings) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Session(org.hibernate.Session) Constructor(java.lang.reflect.Constructor) ArrayList(java.util.ArrayList) HibernateProxy(org.hibernate.proxy.HibernateProxy) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Map(java.util.Map) Query(org.hibernate.query.Query) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) Order(jakarta.persistence.criteria.Order) BigIntJdbcType(org.hibernate.type.descriptor.jdbc.BigIntJdbcType) Transformers(org.hibernate.transform.Transformers) Iterator(java.util.Iterator) ListJoin(jakarta.persistence.criteria.ListJoin) ReflectHelper(org.hibernate.internal.util.ReflectHelper) DomainModel(org.hibernate.testing.orm.junit.DomainModel) AliasToBeanConstructorResultTransformer(org.hibernate.transform.AliasToBeanConstructorResultTransformer) Selection(jakarta.persistence.criteria.Selection) CacheMode(org.hibernate.CacheMode) Assertions.assertSame(org.junit.jupiter.api.Assertions.assertSame) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Test(org.junit.jupiter.api.Test) MapJoin(jakarta.persistence.criteria.MapJoin) List(java.util.List) Root(jakarta.persistence.criteria.Root) SessionFactoryScope(org.hibernate.testing.orm.junit.SessionFactoryScope) CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) JpaRoot(org.hibernate.query.criteria.JpaRoot) LongJavaType(org.hibernate.type.descriptor.java.LongJavaType) Setting(org.hibernate.testing.orm.junit.Setting) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) AliasToEntityMapResultTransformer(org.hibernate.transform.AliasToEntityMapResultTransformer) SessionFactory(org.hibernate.testing.orm.junit.SessionFactory) Path(jakarta.persistence.criteria.Path) Hibernate(org.hibernate.Hibernate) ResultTransformer(org.hibernate.transform.ResultTransformer) Type(org.hibernate.type.Type) Join(jakarta.persistence.criteria.Join) ArrayList(java.util.ArrayList) List(java.util.List) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Map(java.util.Map) Session(org.hibernate.Session) Test(org.junit.jupiter.api.Test)

Example 3 with Join

use of jakarta.persistence.criteria.Join in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testJoinWithFetchJoinWithAliasedJoinedAndOwnerProjectedList.

@Test
public void testJoinWithFetchJoinWithAliasedJoinedAndOwnerProjectedList(SessionFactoryScope scope) throws Exception {
    CriteriaExecutor criteriaExecutor = new CriteriaExecutor() {

        @Override
        protected ResultTransformer getResultTransformer() {
            return null;
        }

        @Override
        protected JpaCriteriaQuery getCriteria(Session s) {
            CriteriaBuilder builder = s.getCriteriaBuilder();
            JpaCriteriaQuery criteria = (JpaCriteriaQuery) builder.createQuery(Object[].class);
            JpaRoot<Student> root = criteria.from(Student.class);
            final JpaSelection<Student> st = root.alias("s");
            root.fetch("enrolments", JoinType.LEFT);
            final Selection<Object> pc = root.join("preferredCourse", JoinType.LEFT).alias("pc");
            criteria.orderBy(builder.asc(root.get("studentNumber")));
            criteria.multiselect(pc, st);
            return criteria;
        }
    };
    HqlExecutor hqlSelectNewMapExecutor = new HqlExecutor() {

        @Override
        public Query getQuery(Session s) {
            return s.createQuery("select pc, s from Student s left join fetch s.enrolments left join s.preferredCourse pc order by s.studentNumber");
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        Object[] yogiObjects = (Object[]) resultList.get(0);
        assertEquals(yogiExpected, yogiObjects[1]);
        assertEquals(yogiExpected.getPreferredCourse().getCourseCode(), ((Course) yogiObjects[0]).getCourseCode());
        Object[] shermanObjects = (Object[]) resultList.get(1);
        assertEquals(shermanExpected, shermanObjects[1]);
        assertNull(shermanObjects[0]);
        if (areDynamicNonLazyAssociationsChecked()) {
            assertEquals(yogiExpected.getPreferredCourse(), yogiObjects[0]);
            assertTrue(Hibernate.isInitialized(((Student) yogiObjects[1]).getEnrolments()));
            assertEquals(yogiExpected.getEnrolments(), ((Student) yogiObjects[1]).getEnrolments());
            assertTrue(Hibernate.isInitialized(((Student) shermanObjects[1]).getEnrolments()));
            assertEquals(shermanExpected.getEnrolments(), (((Student) shermanObjects[1]).getEnrolments()));
        }
    };
    runTest(hqlSelectNewMapExecutor, criteriaExecutor, checker, false, scope);
}
Also used : CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) BasicTypeImpl(org.hibernate.type.internal.BasicTypeImpl) ServiceRegistry(org.hibernate.testing.orm.junit.ServiceRegistry) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) JoinType(jakarta.persistence.criteria.JoinType) JpaSelection(org.hibernate.query.criteria.JpaSelection) AvailableSettings(org.hibernate.cfg.AvailableSettings) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Session(org.hibernate.Session) Constructor(java.lang.reflect.Constructor) ArrayList(java.util.ArrayList) HibernateProxy(org.hibernate.proxy.HibernateProxy) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Map(java.util.Map) Query(org.hibernate.query.Query) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) Order(jakarta.persistence.criteria.Order) BigIntJdbcType(org.hibernate.type.descriptor.jdbc.BigIntJdbcType) Transformers(org.hibernate.transform.Transformers) Iterator(java.util.Iterator) ListJoin(jakarta.persistence.criteria.ListJoin) ReflectHelper(org.hibernate.internal.util.ReflectHelper) DomainModel(org.hibernate.testing.orm.junit.DomainModel) AliasToBeanConstructorResultTransformer(org.hibernate.transform.AliasToBeanConstructorResultTransformer) Selection(jakarta.persistence.criteria.Selection) CacheMode(org.hibernate.CacheMode) Assertions.assertSame(org.junit.jupiter.api.Assertions.assertSame) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Test(org.junit.jupiter.api.Test) MapJoin(jakarta.persistence.criteria.MapJoin) List(java.util.List) Root(jakarta.persistence.criteria.Root) SessionFactoryScope(org.hibernate.testing.orm.junit.SessionFactoryScope) CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) JpaRoot(org.hibernate.query.criteria.JpaRoot) LongJavaType(org.hibernate.type.descriptor.java.LongJavaType) Setting(org.hibernate.testing.orm.junit.Setting) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) AliasToEntityMapResultTransformer(org.hibernate.transform.AliasToEntityMapResultTransformer) SessionFactory(org.hibernate.testing.orm.junit.SessionFactory) Path(jakarta.persistence.criteria.Path) Hibernate(org.hibernate.Hibernate) ResultTransformer(org.hibernate.transform.ResultTransformer) Type(org.hibernate.type.Type) Join(jakarta.persistence.criteria.Join) ArrayList(java.util.ArrayList) List(java.util.List) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Session(org.hibernate.Session) Test(org.junit.jupiter.api.Test)

Example 4 with Join

use of jakarta.persistence.criteria.Join in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testJoinWithFetchJoinWithOwnerAndPropProjectedList.

@Test
public void testJoinWithFetchJoinWithOwnerAndPropProjectedList(SessionFactoryScope scope) throws Exception {
    CriteriaExecutor criteriaExecutor = new CriteriaExecutor() {

        @Override
        protected ResultTransformer getResultTransformer() {
            return null;
        }

        @Override
        protected JpaCriteriaQuery getCriteria(Session s) {
            CriteriaBuilder builder = s.getCriteriaBuilder();
            JpaCriteriaQuery criteria = (JpaCriteriaQuery) builder.createQuery(Object[].class);
            JpaRoot<Student> root = criteria.from(Student.class);
            root.fetch("enrolments", JoinType.LEFT);
            root.join("preferredCourse", JoinType.LEFT);
            criteria.orderBy(builder.asc(root.get("studentNumber")));
            criteria.multiselect(root, root.get("name"));
            return criteria;
        }
    };
    HqlExecutor hqlSelectNewMapExecutor = new HqlExecutor() {

        @Override
        public Query getQuery(Session s) {
            return s.createQuery("select s, s.name from Student s left join fetch s.enrolments left join s.preferredCourse order by s.studentNumber");
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        Object[] yogiObjects = (Object[]) resultList.get(0);
        assertEquals(yogiExpected, yogiObjects[0]);
        assertEquals(yogiExpected.getName(), yogiObjects[1]);
        Object[] shermanObjects = (Object[]) resultList.get(1);
        assertEquals(shermanExpected, shermanObjects[0]);
        assertEquals(shermanExpected.getName(), shermanObjects[1]);
        if (areDynamicNonLazyAssociationsChecked()) {
            assertTrue(Hibernate.isInitialized(((Student) yogiObjects[0]).getEnrolments()));
            assertEquals(yogiExpected.getEnrolments(), ((Student) yogiObjects[0]).getEnrolments());
            assertTrue(Hibernate.isInitialized(((Student) shermanObjects[0]).getEnrolments()));
            assertEquals(shermanExpected.getEnrolments(), (((Student) shermanObjects[0]).getEnrolments()));
        }
    };
    runTest(hqlSelectNewMapExecutor, criteriaExecutor, checker, false, scope);
}
Also used : CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) BasicTypeImpl(org.hibernate.type.internal.BasicTypeImpl) ServiceRegistry(org.hibernate.testing.orm.junit.ServiceRegistry) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) JoinType(jakarta.persistence.criteria.JoinType) JpaSelection(org.hibernate.query.criteria.JpaSelection) AvailableSettings(org.hibernate.cfg.AvailableSettings) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Session(org.hibernate.Session) Constructor(java.lang.reflect.Constructor) ArrayList(java.util.ArrayList) HibernateProxy(org.hibernate.proxy.HibernateProxy) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Map(java.util.Map) Query(org.hibernate.query.Query) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) Order(jakarta.persistence.criteria.Order) BigIntJdbcType(org.hibernate.type.descriptor.jdbc.BigIntJdbcType) Transformers(org.hibernate.transform.Transformers) Iterator(java.util.Iterator) ListJoin(jakarta.persistence.criteria.ListJoin) ReflectHelper(org.hibernate.internal.util.ReflectHelper) DomainModel(org.hibernate.testing.orm.junit.DomainModel) AliasToBeanConstructorResultTransformer(org.hibernate.transform.AliasToBeanConstructorResultTransformer) Selection(jakarta.persistence.criteria.Selection) CacheMode(org.hibernate.CacheMode) Assertions.assertSame(org.junit.jupiter.api.Assertions.assertSame) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Test(org.junit.jupiter.api.Test) MapJoin(jakarta.persistence.criteria.MapJoin) List(java.util.List) Root(jakarta.persistence.criteria.Root) SessionFactoryScope(org.hibernate.testing.orm.junit.SessionFactoryScope) CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) JpaRoot(org.hibernate.query.criteria.JpaRoot) LongJavaType(org.hibernate.type.descriptor.java.LongJavaType) Setting(org.hibernate.testing.orm.junit.Setting) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) AliasToEntityMapResultTransformer(org.hibernate.transform.AliasToEntityMapResultTransformer) SessionFactory(org.hibernate.testing.orm.junit.SessionFactory) Path(jakarta.persistence.criteria.Path) Hibernate(org.hibernate.Hibernate) ResultTransformer(org.hibernate.transform.ResultTransformer) Type(org.hibernate.type.Type) Join(jakarta.persistence.criteria.Join) ArrayList(java.util.ArrayList) List(java.util.List) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Session(org.hibernate.Session) Test(org.junit.jupiter.api.Test)

Example 5 with Join

use of jakarta.persistence.criteria.Join in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testMultiSelectNewMapUsingAliasesWithFetchJoinList.

@Test
public void testMultiSelectNewMapUsingAliasesWithFetchJoinList(SessionFactoryScope scope) throws Exception {
    CriteriaExecutor criteriaExecutor = new CriteriaExecutor() {

        @Override
        protected ResultTransformer getResultTransformer() {
            return null;
        }

        @Override
        protected JpaCriteriaQuery getCriteria(Session s) {
            CriteriaBuilder builder = s.getCriteriaBuilder();
            JpaCriteriaQuery criteria = (JpaCriteriaQuery) builder.createQuery(Map.class);
            Root<Student> root = criteria.from(Student.class);
            final Selection<Student> studentAlias = root.alias("s");
            final Selection<Object> pcAlias = root.join("preferredCourse", JoinType.LEFT).alias("pc");
            root.fetch("enrolments", JoinType.LEFT);
            criteria.multiselect(studentAlias, pcAlias);
            criteria.orderBy(builder.asc(root.get("studentNumber")));
            return criteria;
        // return s.createCriteria( Student.class, "s" )
        // .createAlias( "s.preferredCourse", "pc", Criteria.LEFT_JOIN  )
        // .setFetchMode( "enrolments", FetchMode.JOIN )
        // .addOrder( Order.asc( "s.studentNumber" ))
        // .setResultTransformer( Transformers.ALIAS_TO_ENTITY_MAP );
        }
    };
    HqlExecutor hqlSelectNewMapExecutor = new HqlExecutor() {

        @Override
        public Query getQuery(Session s) {
            return s.createQuery("select new map(s as s, pc as pc) from Student s left join s.preferredCourse pc left join fetch s.enrolments order by s.studentNumber");
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        Map yogiMap = (Map) resultList.get(0);
        assertEquals(yogiExpected, yogiMap.get("s"));
        assertEquals(yogiExpected.getPreferredCourse(), yogiMap.get("pc"));
        Map shermanMap = (Map) resultList.get(1);
        assertEquals(shermanExpected, shermanMap.get("s"));
        assertNull(shermanMap.get("pc"));
        if (areDynamicNonLazyAssociationsChecked()) {
            assertTrue(Hibernate.isInitialized(((Student) yogiMap.get("s")).getEnrolments()));
            assertEquals(yogiExpected.getEnrolments(), ((Student) yogiMap.get("s")).getEnrolments());
            assertTrue(Hibernate.isInitialized(((Student) shermanMap.get("s")).getEnrolments()));
            assertEquals(shermanExpected.getEnrolments(), (((Student) shermanMap.get("s")).getEnrolments()));
        }
    };
    runTest(hqlSelectNewMapExecutor, criteriaExecutor, checker, false, scope);
}
Also used : CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) BasicTypeImpl(org.hibernate.type.internal.BasicTypeImpl) ServiceRegistry(org.hibernate.testing.orm.junit.ServiceRegistry) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) JoinType(jakarta.persistence.criteria.JoinType) JpaSelection(org.hibernate.query.criteria.JpaSelection) AvailableSettings(org.hibernate.cfg.AvailableSettings) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Session(org.hibernate.Session) Constructor(java.lang.reflect.Constructor) ArrayList(java.util.ArrayList) HibernateProxy(org.hibernate.proxy.HibernateProxy) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Map(java.util.Map) Query(org.hibernate.query.Query) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) SessionFactoryImplementor(org.hibernate.engine.spi.SessionFactoryImplementor) Order(jakarta.persistence.criteria.Order) BigIntJdbcType(org.hibernate.type.descriptor.jdbc.BigIntJdbcType) Transformers(org.hibernate.transform.Transformers) Iterator(java.util.Iterator) ListJoin(jakarta.persistence.criteria.ListJoin) ReflectHelper(org.hibernate.internal.util.ReflectHelper) DomainModel(org.hibernate.testing.orm.junit.DomainModel) AliasToBeanConstructorResultTransformer(org.hibernate.transform.AliasToBeanConstructorResultTransformer) Selection(jakarta.persistence.criteria.Selection) CacheMode(org.hibernate.CacheMode) Assertions.assertSame(org.junit.jupiter.api.Assertions.assertSame) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Test(org.junit.jupiter.api.Test) MapJoin(jakarta.persistence.criteria.MapJoin) List(java.util.List) Root(jakarta.persistence.criteria.Root) SessionFactoryScope(org.hibernate.testing.orm.junit.SessionFactoryScope) CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) JpaRoot(org.hibernate.query.criteria.JpaRoot) LongJavaType(org.hibernate.type.descriptor.java.LongJavaType) Setting(org.hibernate.testing.orm.junit.Setting) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) AliasToEntityMapResultTransformer(org.hibernate.transform.AliasToEntityMapResultTransformer) SessionFactory(org.hibernate.testing.orm.junit.SessionFactory) Path(jakarta.persistence.criteria.Path) Hibernate(org.hibernate.Hibernate) ResultTransformer(org.hibernate.transform.ResultTransformer) Type(org.hibernate.type.Type) Join(jakarta.persistence.criteria.Join) ArrayList(java.util.ArrayList) List(java.util.List) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) Map(java.util.Map) Session(org.hibernate.Session) Test(org.junit.jupiter.api.Test)

Aggregations

Join (jakarta.persistence.criteria.Join)55 CriteriaBuilder (jakarta.persistence.criteria.CriteriaBuilder)51 List (java.util.List)48 ListJoin (jakarta.persistence.criteria.ListJoin)28 MapJoin (jakarta.persistence.criteria.MapJoin)28 Root (jakarta.persistence.criteria.Root)25 Selection (jakarta.persistence.criteria.Selection)25 ArrayList (java.util.ArrayList)25 JoinType (jakarta.persistence.criteria.JoinType)24 Order (jakarta.persistence.criteria.Order)24 Path (jakarta.persistence.criteria.Path)24 Constructor (java.lang.reflect.Constructor)24 Iterator (java.util.Iterator)24 Map (java.util.Map)24 CacheMode (org.hibernate.CacheMode)24 Hibernate (org.hibernate.Hibernate)24 Session (org.hibernate.Session)24 AvailableSettings (org.hibernate.cfg.AvailableSettings)24 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)24 ReflectHelper (org.hibernate.internal.util.ReflectHelper)24