Skip to content

Commit 1158838

Browse files
committed
Graphpocalypse: update the docs and migration guide to reflect that key subgraphs are only for Maps
1 parent 35466f5 commit 1158838

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

documentation/src/main/asciidoc/userguide/chapters/fetching/Fetching.adoc

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,11 @@ include::{extrasdir}/fetching-strategies-dynamic-fetching-entity-subgraph-exampl
264264
----
265265
====
266266

267-
Specifying a subgraph is only valid for an attribute (or its "key") whose type is a ManagedType. So
268-
while an EntityGraph must correspond to an EntityType, a Subgraph is legal for any ManagedType. An
269-
attribute's key is defined as either:
267+
Specifying a subgraph is only valid for an attribute (or its "key") whose type is a ManagedType.
268+
So while an EntityGraph must correspond to an EntityType, a Subgraph is legal for any ManagedType.
270269

271-
* For a singular attribute, the attribute's type must be an IdentifiableType and that IdentifiableType must
272-
have a composite identifier. The "key subgraph" is applied to the identifier type. The
273-
non-key subgraph applies to the attribute's value, which must be a ManagedType.
274-
* For a plural attribute, the attribute must be a Map and the Map's key value must be a ManagedType.
275-
The "key subgraph" is applied to the Map's key type. In this case, the non-key subgraph applies
276-
to the plural attribute's value/element.
270+
If the attribute is a Map and the Map's key is a ManagedType, the "key subgraph" is applied to the Map's key type.
271+
In this case, the non-key subgraph applies to the Map value/element.
277272

278273

279274
[[fetching-strategies-dynamic-fetching-entity-subgraph-subtype]]
@@ -315,14 +310,6 @@ just using a parsed graph rather than a named graph.
315310
The syntax also supports defining "key subgraphs". To specify a key subgraph, `.key` is added
316311
to the end of the attribute name.
317312

318-
.Parsing an entity key graph
319-
====
320-
[source, java, indent=0]
321-
----
322-
include::{example-dir-fetching}/GraphParsingTest.java[tags=fetching-strategies-dynamic-fetching-entity-graph-parsing-key-example-1]
323-
----
324-
====
325-
326313
.Parsing a map key graph
327314
====
328315
[source, java, indent=0]

migration-guide.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ This package has been significantly re-engineered, and the impact of this effort
474474
- some breaking changes to type signatures, and
475475
- a number of deprecations of legacy operations which are now covered by JPA.
476476

477+
Also, a key subgraph now always refers to a `Map` key, and never to an entity id.
478+
477479
We encourage migration to the use of the new JPA-standard operations.
478480

479481
== Deprecations

0 commit comments

Comments
 (0)