Just something to consider...
It might be nice to allow definition of an {{EntityGraph}} for a Query (HQL) "inline", using the syntax defined by the {{GraphParser}} (HHH-12713). E.g.
{code} session.createQuery( "select e ( someLobValue ) from MyEntity e ..." ).list(); {code}
compared to:
{code} session.createQuery( "select e from MyEntity e ..." ) .applyFetchGraph( GraphParser.parse( MyEntity.class, "someLobValue", session ) ) .list(); {code}
Possibly even something like:
{code} session.createQuery( "select e from MyEntity e ..." ) .applyFetchGraph( "e", "someLobValue", session ) .list(); {code}
----
Un-relatedly (mental note)... Currently {{org.hibernate.graph.GraphParser#parse}} takes Session for argument. However, it only ever uses the Session to get the SessionFactory. And conceptually there is no real reason for this to be Session-specific. We ought to add overloads that accept SessionFactory and have the ones accepting Session delegating to the new ones, like we do for the the {{org.hibernate.graph.GraphParser#parseInto}} methods |
|