diff --git a/api/src/main/java/jakarta/persistence/EntityManagerFactory.java b/api/src/main/java/jakarta/persistence/EntityManagerFactory.java index 708b34c8..bcdc4512 100644 --- a/api/src/main/java/jakarta/persistence/EntityManagerFactory.java +++ b/api/src/main/java/jakarta/persistence/EntityManagerFactory.java @@ -366,6 +366,7 @@ public interface EntityManagerFactory extends AutoCloseable { * meaning all entity graphs * @return a map keyed by graph name * @param the specified upper bound on the entity graph types + * @see jakarta.persistence.metamodel.EntityType#getNamedEntityGraphs() * * @since 3.2 */ diff --git a/api/src/main/java/jakarta/persistence/metamodel/EntityType.java b/api/src/main/java/jakarta/persistence/metamodel/EntityType.java index 17e6dc2e..b872b1e8 100644 --- a/api/src/main/java/jakarta/persistence/metamodel/EntityType.java +++ b/api/src/main/java/jakarta/persistence/metamodel/EntityType.java @@ -11,11 +11,17 @@ */ // Contributors: +// Gavin King - 4.0 // Linda DeMichiel - 2.1 // Linda DeMichiel - 2.0 package jakarta.persistence.metamodel; +import jakarta.persistence.EntityGraph; +import jakarta.persistence.NamedEntityGraph; + +import java.util.Map; + /** * An instance of {@code EntityType} represents * an {@linkplain jakarta.persistence.Entity entity} @@ -33,4 +39,15 @@ public interface EntityType * @return entity name */ String getName(); + + /** + * A map keyed by {@linkplain NamedEntityGraph#name graph name}, containing + * every named {@linkplain EntityGraph entity graph} whose root entity type + * is this type. + * @return a map keyed by graph name + * @see jakarta.persistence.EntityManagerFactory#getNamedEntityGraphs(Class) + * + * @since 4.0 + */ + Map> getNamedEntityGraphs(); }