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 Closed ). E.g.
session.createQuery( "select e ( someLobValue ) from MyEntity e ..." ).list();
compared to:
session.createQuery( "select e from MyEntity e ..." )
.applyFetchGraph( GraphParser.parse( MyEntity.class, "someLobValue", session ) )
.list();
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 |