Skip to content

Commit

Permalink
HHH-17466 Fix HANA test issues the second
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Dec 4, 2023
1 parent 971a96d commit b1007cb
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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;
Expand All @@ -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 );
}
Expand All @@ -64,8 +64,8 @@ public void basicAssertions(SessionFactoryScope scope) {
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 );
}
Expand All @@ -74,8 +74,8 @@ public void basicAssertions(SessionFactoryScope scope) {
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 );
}
Expand Down

0 comments on commit b1007cb

Please sign in to comment.