use of org.hibernate.jpa.internal.MutableJpaComplianceImpl in project hibernate-orm by hibernate.
the class JpaComplianceTests method testSettingTrue.
@Test
public void testSettingTrue() {
ServiceRegistryScope.using(() -> new StandardServiceRegistryBuilder().applySetting(AvailableSettings.JPA_COMPLIANCE, true).build(), (serviceRegistryScope) -> {
final SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor) new MetadataSources(serviceRegistryScope.getRegistry()).buildMetadata().buildSessionFactory();
final JpaCompliance jpaCompliance = sessionFactory.getSessionFactoryOptions().getJpaCompliance();
assertAll(jpaCompliance, true);
});
// MutableJpaComplianceImpl defaults its values based on the passed
// `jpaByDefault` (`true` here). ultimately we want to source this
// from `AvailableSettings#JPA_COMPLIANCE`
final MutableJpaComplianceImpl compliance = new MutableJpaComplianceImpl(Collections.emptyMap(), true);
assertAll(compliance, true);
}
use of org.hibernate.jpa.internal.MutableJpaComplianceImpl in project hibernate-orm by hibernate.
the class JpaComplianceTests method testDefaultTrue.
@Test
public void testDefaultTrue() {
// MutableJpaComplianceImpl defaults its values based on the passed
// `jpaByDefault` (`true` here). ultimately we want to source this
// from `AvailableSettings#JPA_COMPLIANCE`
final MutableJpaComplianceImpl compliance = new MutableJpaComplianceImpl(Collections.emptyMap(), true);
assertAll(compliance, true);
}
use of org.hibernate.jpa.internal.MutableJpaComplianceImpl in project hibernate-orm by hibernate.
the class JpaComplianceTests method testDefaultFalseWithOverride.
@Test
public void testDefaultFalseWithOverride() {
// MutableJpaComplianceImpl defaults its values based on the passed
// `jpaByDefault` (`true` here). ultimately we want to source this
// from `AvailableSettings#JPA_COMPLIANCE`
final MutableJpaComplianceImpl compliance = new MutableJpaComplianceImpl(Collections.emptyMap(), false);
compliance.setQueryCompliance(true);
assertOverridden(compliance, false);
}
use of org.hibernate.jpa.internal.MutableJpaComplianceImpl in project hibernate-orm by hibernate.
the class JpaComplianceTests method testDefaultTrueWithOverride.
@Test
public void testDefaultTrueWithOverride() {
// MutableJpaComplianceImpl defaults its values based on the passed
// `jpaByDefault` (`true` here). ultimately we want to source this
// from `AvailableSettings#JPA_COMPLIANCE`
final MutableJpaComplianceImpl compliance = new MutableJpaComplianceImpl(Collections.emptyMap(), true);
compliance.setQueryCompliance(false);
assertOverridden(compliance, true);
}
use of org.hibernate.jpa.internal.MutableJpaComplianceImpl in project hibernate-orm by hibernate.
the class JpaComplianceTests method testSettingFalse.
@Test
public void testSettingFalse() {
ServiceRegistryScope.using(() -> new StandardServiceRegistryBuilder().applySetting(AvailableSettings.JPA_COMPLIANCE, false).build(), (serviceRegistryScope) -> {
final SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor) new MetadataSources(serviceRegistryScope.getRegistry()).buildMetadata().buildSessionFactory();
final JpaCompliance jpaCompliance = sessionFactory.getSessionFactoryOptions().getJpaCompliance();
assertAll(jpaCompliance, false);
});
// MutableJpaComplianceImpl defaults its values based on the passed
// `jpaByDefault` (`true` here). ultimately we want to source this
// from `AvailableSettings#JPA_COMPLIANCE`
final MutableJpaComplianceImpl compliance = new MutableJpaComplianceImpl(Collections.emptyMap(), true);
assertAll(compliance, true);
}
Aggregations