This is an automated email from the ASF dual-hosted git repository.
aadamchik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push:
new 450b875 prefetch semantics docs chapter reorg, clarification
450b875 is described below
commit 450b8755a2e0e52d604d9cafe555201f52839ebd
Author: Andrus Adamchik <[email protected]>
AuthorDate: Thu Jul 30 10:35:15 2020 +0300
prefetch semantics docs chapter reorg, clarification
---
.../src/docs/asciidoc/_cayenne-guide/part2/tuning.adoc | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git
a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/tuning.adoc
b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/tuning.adoc
index a16c12c..7349e05 100644
---
a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/tuning.adoc
+++
b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/tuning.adoc
@@ -25,17 +25,15 @@ Prefetching example:
[source, Java]
----
-ObjectSelect<Artist> query = ObjectSelect
+List<Artist> artists = ObjectSelect
.query(Artist.class)
- // Instructs Cayenne to prefetch one of Artist's relationships.
- // Equivalent to ".prefetch("paintings",
PrefetchTreeNode.DISJOINT_PREFETCH_SEMANTICS)")
- .prefetch(Artist.PAINTINGS.disjoint());
-
-// query is expecuted as usual, but the resulting Artists will have
-// their paintings "inflated"
-List<Artist> artists = query.select(context);
+ .prefetch(Artist.PAINTINGS.disjoint()) // <1>
+ .select(context); // <2>
----
+<1> Instructs Cayenne to prefetch one of Artist's relationships.
+<2> Query is executed as usual, but the resulting Artists will have their
paintings "inflated"
+
All types of relationships can be prefetched - to-one, to-many, flattened. A
prefetch can span multiple relationships:
[source, Java]