|
155 | 155 | import org.hibernate.type.CustomType; |
156 | 156 | import org.hibernate.type.ForeignKeyDirection; |
157 | 157 | import org.hibernate.type.StandardBasicTypes; |
| 158 | +import org.hibernate.type.internal.BasicTypeImpl; |
158 | 159 | import org.hibernate.type.spi.TypeConfiguration; |
159 | 160 | import org.hibernate.usertype.CompositeUserType; |
160 | 161 | import org.hibernate.usertype.ParameterizedType; |
@@ -1877,11 +1878,22 @@ private void resolveLob(final SingularAttributeSourceBasic attributeSource, Simp |
1877 | 1878 | // Resolves whether the property is LOB based on the type attribute on the attribute property source. |
1878 | 1879 | // Essentially this expects the type to map to a CLOB/NCLOB/BLOB sql type internally and compares. |
1879 | 1880 | 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 | + |
1885 | 1897 | if ( basicType instanceof AbstractSingleColumnStandardBasicType ) { |
1886 | 1898 | if ( isLob( basicType.getJdbcType().getDdlTypeCode(), null ) ) { |
1887 | 1899 | value.makeLob(); |
|
0 commit comments