Bug 965833
Summary: | Potential bug in join/fetch/avoidance code | ||
---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Heiko W. Rupp <hrupp> |
Component: | Core Server | Assignee: | Nobody <nobody> |
Status: | ON_QA --- | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 4.7 | CC: | hrupp |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | Bug | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Heiko W. Rupp
2013-05-21 20:07:34 UTC
commit https://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=078a2da4e488645284359940e3df7a61a0299109 Author: Lukas Krejci <lkrejci> Date: Fri May 24 16:43:50 2013 +0200 [BZ 965833 - Potential bug in join/fetch/avoidance code] It is now possible to lazily fetch fields defined in super classes. The avoidance of the join-fetch with limits exposed a missing feature that was present in the code from the day one. It would be failing if the criteria query was used to fetch a custom object (i.e. not the primary persistent class of the criteria object) using an "altered projection" and a fetch would be set on a field defined in a super class of the persistent class of the criteria object. Only by chance this has never happened before, because we don't use the altered projections on the criteria queries that often. Now that we lazily fetch fields much more often (to avoid join fetch with limits) this is a problem even in cases without an altered projection. The fix is fortunately very simple - we need to also search the superclasses of the criteria's persistent class when looking for a field to lazily fetch. The possibility of fields being present in super-classes was taken into account on other places in the CriteriaQueryGenerator class, too. Documentation on the getJoinFetchFields() and alterProjection() was enhanced to hopefully better explain the conditions underwhich you can combine fetching and altered projection together. |