HHH-17466 Fix HANA test issues the second

This commit is contained in:
Christian Beikov 2023-12-04 11:01:55 +01:00
parent 971a96d5bd
commit b1007cbda9
1 changed files with 8 additions and 8 deletions

View File

@ -22,6 +22,7 @@ import org.hibernate.metamodel.mapping.PluralAttributeMapping;
import org.hibernate.metamodel.mapping.internal.BasicAttributeMapping;
import org.hibernate.metamodel.mapping.internal.BasicValuedCollectionPart;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.JiraKey;
@ -46,16 +47,15 @@ public class LocaleMappingTests {
@Test
public void basicAssertions(SessionFactoryScope scope) {
final SessionFactoryImplementor sessionFactory = scope.getSessionFactory();
final Dialect dialect = sessionFactory.getJdbcServices().getDialect();
final NationalizationSupport nationalizationSupport = dialect.getNationalizationSupport();
final JdbcTypeRegistry jdbcTypeRegistry = sessionFactory.getTypeConfiguration().getJdbcTypeRegistry();
final EntityPersister entityDescriptor = sessionFactory.getMappingMetamodel().getEntityDescriptor(
LocaleMappingTestEntity.class );
{
final BasicAttributeMapping localeAttribute = (BasicAttributeMapping) entityDescriptor.findAttributeMapping(
"locale" );
assertThat( localeAttribute.getJdbcMapping().getJdbcType().getJdbcTypeCode() )
.isEqualTo( nationalizationSupport.getVarcharVariantCode() );
assertThat( localeAttribute.getJdbcMapping().getJdbcType() )
.isEqualTo( jdbcTypeRegistry.getDescriptor( Types.VARCHAR ) );
assertThat( localeAttribute.getJdbcMapping().getJavaTypeDescriptor().getJavaTypeClass() ).isEqualTo(
Locale.class );
}
@ -64,8 +64,8 @@ public class LocaleMappingTests {
final PluralAttributeMapping yearsAttribute = (PluralAttributeMapping) entityDescriptor.findAttributeMapping(
"locales" );
final BasicValuedCollectionPart elementDescriptor = (BasicValuedCollectionPart) yearsAttribute.getElementDescriptor();
assertThat( elementDescriptor.getJdbcMapping().getJdbcType().getJdbcTypeCode() )
.isEqualTo( nationalizationSupport.getVarcharVariantCode() );
assertThat( elementDescriptor.getJdbcMapping().getJdbcType() )
.isEqualTo( jdbcTypeRegistry.getDescriptor( Types.VARCHAR ) );
assertThat( elementDescriptor.getJdbcMapping().getJavaTypeDescriptor().getJavaTypeClass() ).isEqualTo(
Locale.class );
}
@ -74,8 +74,8 @@ public class LocaleMappingTests {
final PluralAttributeMapping countByYearAttribute = (PluralAttributeMapping) entityDescriptor.findAttributeMapping(
"countByLocale" );
final BasicValuedCollectionPart keyDescriptor = (BasicValuedCollectionPart) countByYearAttribute.getIndexDescriptor();
assertThat( keyDescriptor.getJdbcMapping().getJdbcType().getJdbcTypeCode() )
.isEqualTo( nationalizationSupport.getVarcharVariantCode() );
assertThat( keyDescriptor.getJdbcMapping().getJdbcType() )
.isEqualTo( jdbcTypeRegistry.getDescriptor( Types.VARCHAR ) );
assertThat( keyDescriptor.getJdbcMapping().getJavaTypeDescriptor().getJavaTypeClass() ).isEqualTo(
Locale.class );
}