Annotation Interface EntityGraph
Annotation to configure the JPA 2.1
EntityGraph
s that should be used on repository methods.
Since 1.9 we support the definition of dynamic EntityGraph
s 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, Aleksei Elin
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum for JPA 2.1EntityGraph
types. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionString[]
The paths of attributes of thisEntityGraph
to use, empty by default.TheEntityGraph.EntityGraphType
of 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.EntityGraphType
of the EntityGraph to use, defaults toEntityGraph.EntityGraphType.FETCH
.- Returns:
- Default:
- FETCH
-
attributePaths
String[] attributePathsThe paths of attributes of thisEntityGraph
to use, empty by default. You can refer to direct properties of the entity or nested properties via aproperty.nestedProperty
.- Returns:
- Since:
- 1.9
- Default:
- {}
-