HHH-17177 Convert the JDBC type code for an id attribute from XML into an annotation
This commit is contained in:
parent
8155b6bcda
commit
7048a72c61
|
@ -1768,6 +1768,7 @@ public class JPAXMLOverriddenAnnotationReader implements AnnotationReader {
|
||||||
annotationList.add( AnnotationFactory.create( id ) );
|
annotationList.add( AnnotationFactory.create( id ) );
|
||||||
getAccessType( annotationList, element.getAccess() );
|
getAccessType( annotationList, element.getAccess() );
|
||||||
getType( annotationList, element.getType() );
|
getType( annotationList, element.getType() );
|
||||||
|
getJdbcTypeCode( annotationList, element.getJdbcTypeCode() );
|
||||||
getUuidGenerator( annotationList, element.getUuidGenerator() );
|
getUuidGenerator( annotationList, element.getUuidGenerator() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,14 @@ public class HibernateOrmSpecificAttributesMappingTest {
|
||||||
@Test
|
@Test
|
||||||
public void verifyMapping(DomainModelScope scope) {
|
public void verifyMapping(DomainModelScope scope) {
|
||||||
scope.withHierarchy( HibernateOrmSpecificAttributesMappingTest.MyEntity.class, (entityDescriptor) -> {
|
scope.withHierarchy( HibernateOrmSpecificAttributesMappingTest.MyEntity.class, (entityDescriptor) -> {
|
||||||
Generator generator = entityDescriptor.getIdentifierProperty().createGenerator( null );
|
Property identifierProperty = entityDescriptor.getIdentifierProperty();
|
||||||
|
Generator generator = identifierProperty.createGenerator( null );
|
||||||
assertThat( generator )
|
assertThat( generator )
|
||||||
.isInstanceOf( UuidGenerator.class );
|
.isInstanceOf( UuidGenerator.class );
|
||||||
|
assertThat( identifierProperty.getValue() )
|
||||||
|
.isInstanceOf( BasicValue.class );
|
||||||
|
assertThat( ( (BasicValue) identifierProperty.getValue() ).getExplicitJdbcTypeCode() )
|
||||||
|
.isEqualTo( SqlTypes.CHAR );
|
||||||
|
|
||||||
Property name = entityDescriptor.getProperty( "name" );
|
Property name = entityDescriptor.getProperty( "name" );
|
||||||
assertThat( name.getValue() )
|
assertThat( name.getValue() )
|
||||||
|
|
|
@ -10,9 +10,11 @@
|
||||||
<package>org.hibernate.orm.test.boot.jaxb.mapping</package>
|
<package>org.hibernate.orm.test.boot.jaxb.mapping</package>
|
||||||
<entity class="HibernateOrmSpecificAttributesMappingTest$MyEntity">
|
<entity class="HibernateOrmSpecificAttributesMappingTest$MyEntity">
|
||||||
<attributes>
|
<attributes>
|
||||||
<id name="id">
|
<!-- 1 == CHAR -->
|
||||||
|
<id name="id" jdbc-type-code="1">
|
||||||
<uuid-generator style="time"/>
|
<uuid-generator style="time"/>
|
||||||
</id>
|
</id>
|
||||||
|
<!-- 2005 == CLOB -->
|
||||||
<basic name="name" jdbc-type-code="2005"/>
|
<basic name="name" jdbc-type-code="2005"/>
|
||||||
<basic name="tags">
|
<basic name="tags">
|
||||||
<type value="org.hibernate.orm.test.boot.jaxb.mapping.HibernateOrmSpecificAttributesMappingTest$DelimitedStringsJavaType"/>
|
<type value="org.hibernate.orm.test.boot.jaxb.mapping.HibernateOrmSpecificAttributesMappingTest$DelimitedStringsJavaType"/>
|
||||||
|
|
Loading…
Reference in New Issue