HHH-13097 Don't throw an exception if there are two getter candidates
This commit is contained in:
parent
36078065ea
commit
79a8f43ba5
|
@ -104,15 +104,10 @@ class ByteBuddyEnhancementContext {
|
||||||
|
|
||||||
if ( getCandidate != null ) {
|
if ( getCandidate != null ) {
|
||||||
if ( isCandidate != null ) {
|
if ( isCandidate != null ) {
|
||||||
throw new MappingException(
|
// if there are two candidates, the existing code considered there was no getter.
|
||||||
String.format(
|
// not sure it's such a good idea but throwing an exception apparently throws exception
|
||||||
Locale.ROOT,
|
// in cases where Hibernate does not usually throw a mapping error.
|
||||||
"In trying to locate getter for property [%s], Class [%s] defined " +
|
return Optional.empty();
|
||||||
"both a `get` [%s] and `is` [%s] variant",
|
|
||||||
fieldDescription.getName(),
|
|
||||||
fieldDescription.getDeclaringType().getActualName(),
|
|
||||||
getCandidate.getActualName(),
|
|
||||||
isCandidate.getActualName() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Optional.of( getCandidate );
|
return Optional.of( getCandidate );
|
||||||
|
|
Loading…
Reference in New Issue