From 5b5ec673b4ca35ea271a62890a18974242ca8aa5 Mon Sep 17 00:00:00 2001 From: David Mansfield Date: Tue, 29 Mar 2011 14:16:00 -0400 Subject: [PATCH] HHH-3646 - documentation for Criteria query of collection-of-component and collection-of-scalar functionality --- .../manual/en-US/content/query_criteria.xml | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml b/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml index 466a14da11..3597978c36 100644 --- a/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml +++ b/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml @@ -251,7 +251,7 @@ while ( iter.hasNext() ) { -
+
Components @@ -268,6 +268,39 @@ while ( iter.hasNext() ) { .list();]]> + + Note: this does not apply when querying collections of components, for that see below + + + +
+ +
+ Collections + + When using criteria against collections, there are two distinct cases. One is if + the collection contains entities (eg. <one-to-many/> + or <many-to-many/>) or components + (<composite-element/> ), + and the second is if the collection contains scalar values + (<element/>). + In the first case, the syntax is as given above in the section + where we restrict the kittens + collection. Essentially we create a Criteria object against the collection + property and restrict the entity or component properties using that instance. + + + For queryng a collection of basic values, we still create the Criteria + object against the collection, but to reference the value, we use the special property + "elements". For an indexed collection, we can also reference the index property using + the special property "indices". + + +