-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Left Join Fetch on Embeddable ElementColection fails & NamedQuery with QueryHints.REFRESH fails to execute #1465
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Gaurav Gupta <[email protected]>
Signed-off-by: Gaurav Gupta <[email protected]>
…tions in UnitOfWork Signed-off-by: Jonathan Coustick <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a test, reliance on NPE being thrown is not an acceptable solution.
try { | ||
mapping.preInitialize(session); | ||
} catch (NullPointerException npe) { | ||
// A NPE gets thrown if the expected method is not present for the mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed at the origin of failure.
@@ -3021,7 +3021,7 @@ public Object internalRegisterObject(Object object, ClassDescriptor descriptor, | |||
return null; | |||
} | |||
if (descriptor.isDescriptorTypeAggregate()) { | |||
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(object.getClass()); | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate why this is fixing the issue? Technically I see you are stopping the exception from being thrown, of course. Is this a try-and-error fix, or some deeper understanding? To me it seems the method should not have been called in the first place for those aggregates.
Fixes issue 1:
JPA Left Join Fetch on Embeddable ElementColection fails
#858
Fixes issue 2:
When defining a NamedQuery that has EclipseLink hints, the query fails with an exception
The offending NamedQuery, org.eclipse.persistence.config.QueryHints
Sample test app:
fish-406.zip