Skip to content
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