Skip to content

Commit c496a1b

Browse files
cigalybeikov
authored andcommitted
HHH-19589 If property is annotated with @convert do not check for (registered) user type
1 parent 1adbcfa commit c496a1b

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -332,24 +332,25 @@ public void setType(
332332
if ( converterDescriptor != null ) {
333333
applyJpaConverter( value, converterDescriptor );
334334
}
335-
336-
final Class<? extends UserType<?>> userTypeImpl =
337-
kind.mappingAccess.customType( value, getSourceModelContext() );
338-
if ( userTypeImpl != null ) {
339-
applyExplicitType( userTypeImpl,
340-
kind.mappingAccess.customTypeParameters( value, getSourceModelContext() ) );
341-
// An explicit custom UserType has top precedence when we get to BasicValue resolution.
342-
return;
343-
}
344-
else if ( modelClassDetails != null ) {
345-
final ClassDetails rawClassDetails = modelClassDetails.determineRawClass();
346-
final Class<?> basicClass = rawClassDetails.toJavaClass();
347-
final Class<? extends UserType<?>> registeredUserTypeImpl =
348-
getMetadataCollector().findRegisteredUserType( basicClass );
349-
if ( registeredUserTypeImpl != null ) {
350-
applyExplicitType( registeredUserTypeImpl, emptyMap() );
335+
else {
336+
final Class<? extends UserType<?>> userTypeImpl =
337+
kind.mappingAccess.customType( value, getSourceModelContext() );
338+
if ( userTypeImpl != null ) {
339+
applyExplicitType( userTypeImpl,
340+
kind.mappingAccess.customTypeParameters( value, getSourceModelContext() ) );
341+
// An explicit custom UserType has top precedence when we get to BasicValue resolution.
351342
return;
352343
}
344+
else if ( modelClassDetails != null ) {
345+
final ClassDetails rawClassDetails = modelClassDetails.determineRawClass();
346+
final Class<?> basicClass = rawClassDetails.toJavaClass();
347+
final Class<? extends UserType<?>> registeredUserTypeImpl =
348+
getMetadataCollector().findRegisteredUserType( basicClass );
349+
if ( registeredUserTypeImpl != null ) {
350+
applyExplicitType( registeredUserTypeImpl, emptyMap() );
351+
return;
352+
}
353+
}
353354
}
354355

355356
switch ( kind ) {

0 commit comments

Comments
 (0)