@@ -314,34 +314,47 @@ public interface SharedSessionContract extends QueryProducer, AutoCloseable, Ser
314314 <T > T doReturningWork (ReturningWork <T > work );
315315
316316 /**
317- * Create a new mutable {@link EntityGraph} with only a root node.
317+ * Create a new mutable instance of {@link EntityGraph}, with only
318+ * a root node, allowing programmatic definition of the graph from
319+ * scratch.
318320 *
319321 * @param rootType the root entity class of the graph
320322 *
321323 * @since 6.3
324+ *
325+ * @see org.hibernate.graph.EntityGraphs#createGraph(jakarta.persistence.metamodel.EntityType)
322326 */
323327 <T > RootGraph <T > createEntityGraph (Class <T > rootType );
324328
325329 /**
326- * Create a new mutable copy of the named {@link EntityGraph},
327- * or return {@code null} if there is no graph with the given
328- * name.
330+ * Create a new mutable instance of {@link EntityGraph}, based on
331+ * a predefined {@linkplain jakarta.persistence.NamedEntityGraph
332+ * named entity graph}, allowing customization of the graph, or
333+ * return {@code null} if there is no predefined graph with the
334+ * given name.
329335 *
330336 * @param graphName the name of the graph
331337 *
338+ * @apiNote This method returns {@code RootGraph<?>}, requiring an
339+ * unchecked typecast before use. It's cleaner to obtain a graph using
340+ * {@link #createEntityGraph(Class, String)} instead.
341+ *
342+ * @see SessionFactory#getNamedEntityGraphs(Class)
332343 * @see jakarta.persistence.EntityManagerFactory#addNamedEntityGraph(String, EntityGraph)
333344 *
334345 * @since 6.3
335346 */
336347 RootGraph <?> createEntityGraph (String graphName );
337348
338349 /**
339- * Create a new mutable copy of the named {@link EntityGraph},
340- * or return {@code null} if there is no graph with the given
341- * name.
350+ * Create a new mutable instance of {@link EntityGraph}, based on
351+ * a predefined {@linkplain jakarta.persistence.NamedEntityGraph
352+ * named entity graph}, allowing customization of the graph, or
353+ * return {@code null} if there is no predefined graph with the
354+ * given name.
342355 *
343356 * @param rootType the root entity class of the graph
344- * @param graphName the name of the graph
357+ * @param graphName the name of the predefined named entity graph
345358 *
346359 * @see jakarta.persistence.EntityManagerFactory#addNamedEntityGraph(String, EntityGraph)
347360 *
@@ -353,21 +366,29 @@ public interface SharedSessionContract extends QueryProducer, AutoCloseable, Ser
353366 <T > RootGraph <T > createEntityGraph (Class <T > rootType , String graphName );
354367
355368 /**
356- * Retrieve the named {@link EntityGraph} as an immutable graph,
357- * or return {@code null} if there is no graph with the given
369+ * Obtain an immutable reference to a predefined
370+ * {@linkplain jakarta.persistence.NamedEntityGraph named entity graph}
371+ * or return {@code null} if there is no predefined graph with the given
358372 * name.
359373 *
360- * @see jakarta.persistence.EntityManagerFactory#addNamedEntityGraph(String, EntityGraph)
374+ * @param graphName the name of the predefined named entity graph
361375 *
362- * @param graphName the name of the graph
376+ * @apiNote This method returns {@code RootGraph<?>}, requiring an
377+ * unchecked typecast before use. It's cleaner to obtain a graph using
378+ * the static metamodel for the class which defines the graph, or by
379+ * calling {@link SessionFactory#getNamedEntityGraphs(Class)} instead.
380+ *
381+ * @see SessionFactory#getNamedEntityGraphs(Class)
382+ * @see jakarta.persistence.EntityManagerFactory#addNamedEntityGraph(String, EntityGraph)
363383 *
364384 * @since 6.3
365385 */
366386 RootGraph <?> getEntityGraph (String graphName );
367387
368388 /**
369- * Retrieve all named {@link EntityGraph}s with the given type.
389+ * Retrieve all named {@link EntityGraph}s with the given root entity type.
370390 *
391+ * @see jakarta.persistence.EntityManagerFactory#getNamedEntityGraphs(Class)
371392 * @see jakarta.persistence.EntityManagerFactory#addNamedEntityGraph(String, EntityGraph)
372393 *
373394 * @since 6.3
0 commit comments