[hibernate-dev] EntityGraph query spaces not applied to Query (HHH-11213)
steve at hibernate.org
Fri Dec 16 20:03:38 EST 2016
It likely is not an issue. Query spaces only come into play with regards
to restrictions. Since the EntityGraph is not part of the query proper
restrictions cannot be based on it.
That would be a scenario to try though... create a query restricting
results based on some joined attribute and then supply an EntityGraph hint
for that attribute. But IMO that is a completely contrived scenario.
On Fri, Dec 16, 2016, 6:09 PM Gail Badner <gbadner at redhat.com> wrote:
> Query spaces for EntityGraph nodes/subgraphs are not currently added
> when applied to a Query, and so the session is not flushed if it
> contains updated data relevant to the EntityGraph that is not in the
> query spaces defined for the Query.
> I originally though this was a critical issue, but now that I'm
> looking into it, I'm not so sure. I am having a hard time coming up
> with a test case where it matters.
> I've created a pull request with the test case attached to HHH-11213,
> with some added checks to detect if the session flushes. 
> In this case, the session does not flush, but the query results are
> still correct because the updated entity is taken from the Session,
> not from the ResultSet returned by the query.
> I wonder now if it really is necessary to flush the Session when the
> session has updates that apply *only* to the EntityGraph (and not to
> the base Query).
>  https://github.com/hibernate/hibernate-orm/pull/1707
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
More information about the hibernate-dev