Skip to content

Commit

Permalink
add getNamedEntityGraphs() to EntityType
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Jan 9, 2025
1 parent 1aac75c commit 8244c18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public interface EntityManagerFactory extends AutoCloseable {
* meaning all entity graphs
* @return a map keyed by graph name
* @param <E> the specified upper bound on the entity graph types
* @see jakarta.persistence.metamodel.EntityType#getNamedEntityGraphs()
*
* @since 3.2
*/
Expand Down
17 changes: 17 additions & 0 deletions api/src/main/java/jakarta/persistence/metamodel/EntityType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -33,4 +39,15 @@ public interface EntityType<X>
* @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<String,EntityGraph<X>> getNamedEntityGraphs();
}

0 comments on commit 8244c18

Please sign in to comment.