Scott Marlow (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-16542 (
https://hibernate.atlassian.net/browse/HHH-16542?atlOrigin=eyJpIjoiNDVlM2...
)
Re: (Jakarta EE 10 Platform TCK)
jpa/core/entitytest/cascadeall/oneXone/cascadeAll1X1Test10 test regression (
https://hibernate.atlassian.net/browse/HHH-16542?atlOrigin=eyJpIjoiNDVlM2...
)
private static void checkGetAndIsVariants(
Class containerClass, String propertyName, Method getMethod, Method
isMethod) {
// Check the return types. If they are the same, its ok. If they are different // we
are in a situation where we could not reasonably know which to use.
if ( !isMethod.getReturnType().equals( getMethod.getReturnType() ) ) {
throw new MappingException(
String.format(
Locale.ROOT, "In trying to locate getter for
property [%s], Class [%s] defined " +
"both a `get` [%s] and `is` [%s] variant",
propertyName, containerClass.getName(),
getMethod.toString(), isMethod.toString()
)
); }
}
Mentioned ReflectHelper code is ^ and error is:
org.hibernate.MappingException: In trying to locate getter for property [b1] , Class
[com.sun.ts.tests.jpa.core.entitytest.cascadeall.oneXone.A] defined both a get [public
com.sun.ts.tests.jpa.core.entitytest.cascadeall.oneXone.B
com.sun.ts.tests.jpa.core.entitytest.cascadeall.oneXone.A.getB1()] and is [public boolean
com.sun.ts.tests.jpa.core.entitytest.cascadeall.oneXone.A.isB1()] variant
The offending TCK source code is:
@OneToOne(targetEntity = com.sun.ts.tests.jpa.core.entitytest.cascadeall.oneXone.B.class,
mappedBy = "a1", orphanRemoval = true)
protected B b1;
public B getB1()
{ return b1; }
public boolean isB1()
{ TestUtil.logTrace("isB1"); if (getB1() != null)
TestUtil.logTrace("Relationship to B is not null..."); else
TestUtil.logTrace("Relationship for B is null ..."); return getB1() != null; }
Apologies for pasting all of the above but it helps me to see it all together as one
comment. 🙂
From the above pasted code + error, I think the test would pass if both methods returned
either B or boolean but is that only a Hibernate requirement or is that also Persistence
Specification requirement?
Could ReflectHelper be enhanced to handle ^ differently in JPA_COMPLIANCE mode?
(
https://hibernate.atlassian.net/browse/HHH-16542#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16542#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100224- sha1:4684446 )