Skip to content

Commit 13162b0

Browse files
committed
HHH-19589 If property is annotated with @convert do not check for (registered) user type
1 parent 9b46863 commit 13162b0

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 var userTypeImpl =
337-
kind.mappingAccess.customType( value, modelContext );
338-
if ( userTypeImpl != null ) {
339-
applyExplicitType( userTypeImpl,
340-
kind.mappingAccess.customTypeParameters( value, modelContext ) );
341-
// An explicit custom UserType has top precedence when we get to BasicValue resolution.
342-
return;
343-
}
344-
else if ( modelClassDetails != null ) {
345-
final var rawClassDetails = modelClassDetails.determineRawClass();
346-
final var basicClass = rawClassDetails.toJavaClass();
347-
final var registeredUserTypeImpl =
348-
getMetadataCollector().findRegisteredUserType( basicClass );
349-
if ( registeredUserTypeImpl != null ) {
350-
applyExplicitType( registeredUserTypeImpl, emptyMap() );
335+
else {
336+
final var userTypeImpl =
337+
kind.mappingAccess.customType( value, modelContext );
338+
if ( userTypeImpl != null ) {
339+
applyExplicitType( userTypeImpl,
340+
kind.mappingAccess.customTypeParameters( value, modelContext ) );
341+
// An explicit custom UserType has top precedence when we get to BasicValue resolution.
351342
return;
352343
}
344+
else if ( modelClassDetails != null ) {
345+
final var rawClassDetails = modelClassDetails.determineRawClass();
346+
final var basicClass = rawClassDetails.toJavaClass();
347+
final var 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)