Skip to content

HHH-16253 - Schema Validation Failure With Audited (N)Clob Column #10589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
import org.hibernate.type.CustomType;
import org.hibernate.type.ForeignKeyDirection;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.internal.BasicTypeImpl;
import org.hibernate.type.spi.TypeConfiguration;
import org.hibernate.usertype.CompositeUserType;
import org.hibernate.usertype.ParameterizedType;
Expand Down Expand Up @@ -1877,11 +1878,22 @@ private void resolveLob(final SingularAttributeSourceBasic attributeSource, Simp
// Resolves whether the property is LOB based on the type attribute on the attribute property source.
// Essentially this expects the type to map to a CLOB/NCLOB/BLOB sql type internally and compares.
if ( !value.isLob() && value.getTypeName() != null ) {
final BasicType<?> basicType = attributeSource.getBuildingContext()
.getMetadataCollector()
.getTypeConfiguration()
.getBasicTypeRegistry()
.getRegisteredType( value.getTypeName() );
BasicType<?> basicType = null;

if ( value.getTypeName().startsWith( BasicTypeImpl.EXTERNALIZED_PREFIX ) ) {
basicType = attributeSource.getBuildingContext()
.getBootstrapContext()
.resolveAdHocBasicType( value.getTypeName() );
}

if ( basicType == null ) {
basicType = attributeSource.getBuildingContext()
.getMetadataCollector()
.getTypeConfiguration()
.getBasicTypeRegistry()
.getRegisteredType( value.getTypeName() );
}

if ( basicType instanceof AbstractSingleColumnStandardBasicType ) {
if ( isLob( basicType.getJdbcType().getDdlTypeCode(), null ) ) {
value.makeLob();
Expand Down
Loading