mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 00:55:16 +00:00
HHH-17466 Fix HANA test issues
This commit is contained in:
parent
c67ea33206
commit
314c621f7b
@ -15,6 +15,8 @@
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.NationalizationSupport;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
|
||||
import org.hibernate.metamodel.mapping.internal.BasicAttributeMapping;
|
||||
@ -44,13 +46,16 @@ 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 EntityPersister entityDescriptor = sessionFactory.getMappingMetamodel().getEntityDescriptor(
|
||||
LocaleMappingTestEntity.class );
|
||||
|
||||
{
|
||||
final BasicAttributeMapping localeAttribute = (BasicAttributeMapping) entityDescriptor.findAttributeMapping(
|
||||
"locale" );
|
||||
assertThat( localeAttribute.getJdbcMapping().getJdbcType().getJdbcTypeCode() ).isEqualTo( Types.VARCHAR );
|
||||
assertThat( localeAttribute.getJdbcMapping().getJdbcType().getJdbcTypeCode() )
|
||||
.isEqualTo( nationalizationSupport.getVarcharVariantCode() );
|
||||
assertThat( localeAttribute.getJdbcMapping().getJavaTypeDescriptor().getJavaTypeClass() ).isEqualTo(
|
||||
Locale.class );
|
||||
}
|
||||
@ -59,7 +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( Types.VARCHAR );
|
||||
assertThat( elementDescriptor.getJdbcMapping().getJdbcType().getJdbcTypeCode() )
|
||||
.isEqualTo( nationalizationSupport.getVarcharVariantCode() );
|
||||
assertThat( elementDescriptor.getJdbcMapping().getJavaTypeDescriptor().getJavaTypeClass() ).isEqualTo(
|
||||
Locale.class );
|
||||
}
|
||||
@ -68,7 +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( Types.VARCHAR );
|
||||
assertThat( keyDescriptor.getJdbcMapping().getJdbcType().getJdbcTypeCode() )
|
||||
.isEqualTo( nationalizationSupport.getVarcharVariantCode() );
|
||||
assertThat( keyDescriptor.getJdbcMapping().getJavaTypeDescriptor().getJavaTypeClass() ).isEqualTo(
|
||||
Locale.class );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user