Search in sources :

Example 6 with JpaRoot

use of org.hibernate.query.criteria.JpaRoot in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testJoinWithFetchJoinList.

@Test
public void testJoinWithFetchJoinList(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);
            Join<Object, Object> preferredCourse = root.join("preferredCourse", JoinType.LEFT);
            root.fetch("enrolments", JoinType.LEFT);
            criteria.orderBy(builder.asc(root.get("studentNumber")));
            criteria.multiselect(root, preferredCourse);
            return criteria;
        }
    };
    HqlExecutor hqlExecutor = new HqlExecutor() {

        @Override
        public Query getQuery(Session s) {
            return s.createQuery("select s, pc 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[0]);
        assertEquals(yogiExpected.getPreferredCourse(), yogiObjects[1]);
        Object[] shermanObjects = (Object[]) resultList.get(1);
        assertEquals(shermanExpected, shermanObjects[0]);
        assertNull(shermanObjects[1]);
        assertNull(((Student) shermanObjects[0]).getPreferredCourse());
        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(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) Session(org.hibernate.Session) Test(org.junit.jupiter.api.Test)

Example 7 with JpaRoot

use of org.hibernate.query.criteria.JpaRoot in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testEntityWithLazyAsList.

@Test
public void testEntityWithLazyAsList(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<Student> criteria = (JpaCriteriaQuery<Student>) builder.createQuery(Student.class);
            JpaRoot<Student> root = criteria.from(Student.class);
            criteria.orderBy(builder.asc(root.get("studentNumber")));
            return criteria;
        // return s.createCriteria( Student.class )
        // .addOrder( Order.asc( "studentNumber" ) );
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        assertEquals(yogiExpected, resultList.get(0));
        assertEquals(shermanExpected, resultList.get(1));
        assertNotNull(((Student) resultList.get(0)).getEnrolments());
        assertNotNull(((Student) resultList.get(0)).getPreferredCourse());
        assertNotNull(((Student) resultList.get(1)).getEnrolments());
        assertNull(((Student) resultList.get(1)).getPreferredCourse());
        assertFalse(Hibernate.isInitialized(((Student) resultList.get(0)).getEnrolments()));
        assertFalse(Hibernate.isInitialized(((Student) resultList.get(0)).getPreferredCourse()));
        assertFalse(Hibernate.isInitialized(((Student) resultList.get(1)).getEnrolments()));
        assertNull(((Student) resultList.get(1)).getPreferredCourse());
    };
    runTest(null, 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 8 with JpaRoot

use of org.hibernate.query.criteria.JpaRoot in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testJoinWithFetchJoinListCriteria.

@Test
public void testJoinWithFetchJoinListCriteria(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<Student> criteria = (JpaCriteriaQuery<Student>) builder.createQuery(Student.class);
            JpaRoot<Student> root = criteria.from(Student.class);
            root.join("preferredCourse", JoinType.LEFT);
            root.fetch("enrolments", JoinType.LEFT);
            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") );
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        assertEquals(yogiExpected, resultList.get(0));
        // The following fails for criteria due to HHH-3524
        // assertEquals( yogiExpected.getPreferredCourse(), ( ( Student ) resultList.get( 0 ) ).getPreferredCourse() );
        assertEquals(yogiExpected.getPreferredCourse().getCourseCode(), ((Student) resultList.get(0)).getPreferredCourse().getCourseCode());
        assertEquals(shermanExpected, resultList.get(1));
        assertNull(((Student) resultList.get(1)).getPreferredCourse());
        if (areDynamicNonLazyAssociationsChecked()) {
            assertTrue(Hibernate.isInitialized(((Student) resultList.get(0)).getEnrolments()));
            assertEquals(yogiExpected.getEnrolments(), ((Student) resultList.get(0)).getEnrolments());
            assertTrue(Hibernate.isInitialized(((Student) resultList.get(1)).getEnrolments()));
            assertEquals(shermanExpected.getEnrolments(), (((Student) resultList.get(1)).getEnrolments()));
        }
    };
    runTest(null, 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 9 with JpaRoot

use of org.hibernate.query.criteria.JpaRoot in project hibernate-orm by hibernate.

the class AbstractQueryCacheResultTransformerTest method testEntityWithNonLazyManyToOneList.

@Test
public void testEntityWithNonLazyManyToOneList(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<CourseMeeting> criteria = (JpaCriteriaQuery<CourseMeeting>) builder.createQuery(CourseMeeting.class);
            JpaRoot<CourseMeeting> root = criteria.from(CourseMeeting.class);
            criteria.orderBy(builder.asc(root.get("id").get("day")));
            return criteria;
        // return s.createCriteria( CourseMeeting.class )
        // .addOrder( Order.asc( "id.day" ) );
        }
    };
    HqlExecutor hqlExecutor = new HqlExecutor() {

        @Override
        protected Query getQuery(Session s) {
            return s.createQuery("from CourseMeeting order by id.day");
        }
    };
    ResultChecker checker = results -> {
        List resultList = (List) results;
        assertEquals(2, resultList.size());
        assertEquals(courseMeetingExpected1, resultList.get(0));
        assertEquals(courseMeetingExpected2, resultList.get(1));
        assertTrue(Hibernate.isInitialized(((CourseMeeting) resultList.get(0)).getCourse()));
        assertTrue(Hibernate.isInitialized(((CourseMeeting) resultList.get(1)).getCourse()));
        assertEquals(courseExpected, ((CourseMeeting) resultList.get(0)).getCourse());
        assertEquals(courseExpected, ((CourseMeeting) resultList.get(1)).getCourse());
    };
    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) Session(org.hibernate.Session) Test(org.junit.jupiter.api.Test)

Example 10 with JpaRoot

use of org.hibernate.query.criteria.JpaRoot in project hibernate-orm by hibernate.

the class CompositeParameterTests method testDeTypedInPredicateCriteria.

@Test
public void testDeTypedInPredicateCriteria(SessionFactoryScope scope) {
    final HibernateCriteriaBuilder builder = scope.getSessionFactory().getCriteriaBuilder();
    final JpaMetamodel jpaMetamodel = scope.getSessionFactory().getRuntimeMetamodels().getJpaMetamodel();
    final EntityDomainType entityDescriptor = jpaMetamodel.entity(SimpleEntity.class);
    final SingularAttribute attribute = entityDescriptor.getSingularAttribute("composite");
    scope.inTransaction((session) -> {
        final JpaCriteriaQuery criteria = builder.createQuery(SimpleEntity.class);
        final JpaRoot root = criteria.from(entityDescriptor);
        final Path attrPath = root.get(attribute);
        final JpaParameterExpression parameter = builder.parameter(SimpleComposite.class);
        criteria.where(builder.in(attrPath, parameter));
        final QueryImplementor query = session.createQuery(criteria);
        query.setParameter(parameter, new SimpleComposite());
        query.list();
    });
}
Also used : Path(jakarta.persistence.criteria.Path) SingularAttribute(jakarta.persistence.metamodel.SingularAttribute) JpaRoot(org.hibernate.query.criteria.JpaRoot) HibernateCriteriaBuilder(org.hibernate.query.criteria.HibernateCriteriaBuilder) EntityDomainType(org.hibernate.metamodel.model.domain.EntityDomainType) JpaMetamodel(org.hibernate.metamodel.model.domain.JpaMetamodel) JpaCriteriaQuery(org.hibernate.query.criteria.JpaCriteriaQuery) JpaParameterExpression(org.hibernate.query.criteria.JpaParameterExpression) QueryImplementor(org.hibernate.query.spi.QueryImplementor) Test(org.junit.jupiter.api.Test)

Aggregations

Path (jakarta.persistence.criteria.Path)17 JpaCriteriaQuery (org.hibernate.query.criteria.JpaCriteriaQuery)17 JpaRoot (org.hibernate.query.criteria.JpaRoot)17 CriteriaBuilder (jakarta.persistence.criteria.CriteriaBuilder)16 Join (jakarta.persistence.criteria.Join)16 JoinType (jakarta.persistence.criteria.JoinType)16 ListJoin (jakarta.persistence.criteria.ListJoin)16 MapJoin (jakarta.persistence.criteria.MapJoin)16 Order (jakarta.persistence.criteria.Order)16 Root (jakarta.persistence.criteria.Root)16 Selection (jakarta.persistence.criteria.Selection)16 Constructor (java.lang.reflect.Constructor)16 ArrayList (java.util.ArrayList)16 Iterator (java.util.Iterator)16 List (java.util.List)16 Map (java.util.Map)16 CacheMode (org.hibernate.CacheMode)16 Hibernate (org.hibernate.Hibernate)16 Session (org.hibernate.Session)16 AvailableSettings (org.hibernate.cfg.AvailableSettings)16