Skip to content

Commit 5851db3

Browse files
author
Armin Krezović
committed
HHH-16253 - Schema Validation Failure With Audited (N)Clob Column
https://hibernate.atlassian.net/browse/HHH-16253 Signed-off-by: Armin Krezović <[email protected]>
1 parent ce0ff93 commit 5851db3

File tree

1 file changed

+17
-5
lines changed
  • hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm

1 file changed

+17
-5
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
import org.hibernate.type.CustomType;
156156
import org.hibernate.type.ForeignKeyDirection;
157157
import org.hibernate.type.StandardBasicTypes;
158+
import org.hibernate.type.internal.BasicTypeImpl;
158159
import org.hibernate.type.spi.TypeConfiguration;
159160
import org.hibernate.usertype.CompositeUserType;
160161
import org.hibernate.usertype.ParameterizedType;
@@ -1877,11 +1878,22 @@ private void resolveLob(final SingularAttributeSourceBasic attributeSource, Simp
18771878
// Resolves whether the property is LOB based on the type attribute on the attribute property source.
18781879
// Essentially this expects the type to map to a CLOB/NCLOB/BLOB sql type internally and compares.
18791880
if ( !value.isLob() && value.getTypeName() != null ) {
1880-
final BasicType<?> basicType = attributeSource.getBuildingContext()
1881-
.getMetadataCollector()
1882-
.getTypeConfiguration()
1883-
.getBasicTypeRegistry()
1884-
.getRegisteredType( value.getTypeName() );
1881+
BasicType<?> basicType = null;
1882+
1883+
if ( value.getTypeName().startsWith( BasicTypeImpl.EXTERNALIZED_PREFIX ) ) {
1884+
basicType = attributeSource.getBuildingContext()
1885+
.getBootstrapContext()
1886+
.resolveAdHocBasicType( value.getTypeName() );
1887+
}
1888+
1889+
if ( basicType == null ) {
1890+
basicType = attributeSource.getBuildingContext()
1891+
.getMetadataCollector()
1892+
.getTypeConfiguration()
1893+
.getBasicTypeRegistry()
1894+
.getRegisteredType( value.getTypeName() );
1895+
}
1896+
18851897
if ( basicType instanceof AbstractSingleColumnStandardBasicType ) {
18861898
if ( isLob( basicType.getJdbcType().getDdlTypeCode(), null ) ) {
18871899
value.makeLob();

0 commit comments

Comments
 (0)