Annotation Interface EntityGraph
Annotation to configure the JPA 2.1
EntityGraphs that should be used on repository methods.
Since 1.9 we support the definition of dynamic EntityGraphs by allowing to customize the fetch-graph via
attributePaths() ad-hoc fetch-graph configuration.
If attributePaths() are specified then we ignore the entity-graph name value() and treat this
EntityGraph as dynamic.- Since:
- 1.6
- Author:
- Christoph Strobl, Thomas Darimont, Oerd Cukalla
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for JPA 2.1EntityGraphtypes. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]The paths of attributes of thisEntityGraphto use, empty by default.TheEntityGraph.EntityGraphTypeof the EntityGraph to use, defaults toEntityGraph.EntityGraphType.FETCH.The name of the EntityGraph to use.
-
Element Details
-
value
String valueThe name of the EntityGraph to use. If empty we fall-back toJpaQueryMethod.getNamedQueryName()as the value.- Returns:
- Default:
- ""
-
type
TheEntityGraph.EntityGraphTypeof the EntityGraph to use, defaults toEntityGraph.EntityGraphType.FETCH.- Returns:
- Default:
- FETCH
-
attributePaths
String[] attributePathsThe paths of attributes of thisEntityGraphto use, empty by default. You can refer to direct properties of the entity or nested properties via aproperty.nestedProperty.- Returns:
- Since:
- 1.9
- Default:
- {}
-