Skip to content

Commit 5eb4f1c

Browse files
committed
Migrate User Guide Criteria chapter extras to test folder
1 parent 008c2dc commit 5eb4f1c

31 files changed

+525
-242
lines changed

documentation/documentation.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,27 @@ if ( JavaVersion.current().isJava8Compatible() ) {
4444
}
4545

4646
dependencies {
47-
ext.pressgangVersion = '3.0.0'
47+
ext.pressgangVersion = '3.0.0'
4848

49-
// asciidoctor 'org.asciidoctor:asciidoctorj:1.5.2'
50-
asciidoclet 'org.asciidoctor:asciidoclet:0.+'
49+
// asciidoctor 'org.asciidoctor:asciidoctorj:1.5.2'
50+
asciidoclet 'org.asciidoctor:asciidoclet:0.+'
5151

52-
jdocbookXsl "org.jboss.pressgang:pressgang-xslt-ns:${pressgangVersion}"
53-
jdocbookXsl "org.jboss.pressgang:pressgang-fonts:${pressgangVersion}"
54-
jdocbookStyles "org.jboss.pressgang:pressgang-jdocbook-style:${pressgangVersion}"
52+
jdocbookXsl "org.jboss.pressgang:pressgang-xslt-ns:${pressgangVersion}"
53+
jdocbookXsl "org.jboss.pressgang:pressgang-fonts:${pressgangVersion}"
54+
jdocbookStyles "org.jboss.pressgang:pressgang-jdocbook-style:${pressgangVersion}"
55+
56+
compile( libraries.jpa )
57+
compile( project( ':hibernate-jpamodelgen' ) )
58+
59+
testCompile( 'org.apache.commons:commons-lang3:3.4' )
5560

5661
testCompile( project(':hibernate-core') )
5762
testCompile( project(':hibernate-entitymanager') )
5863
testCompile( project(':hibernate-ehcache') )
5964

6065
testCompile( project(':hibernate-testing') )
6166
testCompile( project(path: ':hibernate-entitymanager', configuration: 'tests') )
62-
testCompile( 'org.apache.commons:commons-lang3:3.4' )
67+
6368
testRuntime( libraries.h2 )
6469
}
6570

documentation/src/main/asciidoc/userguide/appendices/Legacy_Criteria.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For details on the JPA APIs, see <<chapters/query-criteria/Criteria.adoc#criteri
1212

1313
Hibernate features an intuitive, extensible criteria query API.
1414

15-
[[querycriteria-creating]]
15+
[[criteria-creating]]
1616
=== Creating a `Criteria` instance
1717

1818
The interface `org.hibernate.Criteria` represents a query against a particular persistent class.
@@ -25,7 +25,7 @@ crit.setMaxResults(50);
2525
List cats = crit.list();
2626
----
2727

28-
[[querycriteria-narrowing]]
28+
[[criteria-narrowing]]
2929
=== Narrowing the result set
3030

3131
An individual query criterion is an instance of the interface `org.hibernate.criterion.Criterion`.
@@ -95,7 +95,7 @@ List cats = sess.createCriteria(Cat.class)
9595
.list();
9696
----
9797

98-
[[querycriteria-ordering]]
98+
[[criteria-ordering]]
9999
=== Ordering the results
100100

101101
You can order the results using `org.hibernate.criterion.Order`.
@@ -120,7 +120,7 @@ List cats = sess.createCriteria(Cat.class)
120120
.list();
121121
----
122122

123-
[[querycriteria-associations]]
123+
[[criteria-associations]]
124124
=== Associations
125125

126126
By navigating associations using `createCriteria()` you can specify constraints upon related entities:
@@ -187,7 +187,7 @@ A second query would need to retrieve the cats with mates who's name started wit
187187

188188
Thirdly, in memory; the lists would need to be joined manually.
189189

190-
[[querycriteria-dynamicfetching]]
190+
[[criteria-dynamicfetching]]
191191
=== Dynamic association fetching
192192

193193
You can specify association fetching semantics at runtime using `setFetchMode()`.
@@ -203,7 +203,7 @@ List cats = sess.createCriteria(Cat.class)
203203

204204
This query will fetch both `mate` and `kittens` by outer join.
205205

206-
[[querycriteria-components]]
206+
[[criteria-components]]
207207
=== Components
208208

209209
To add a restriction against a property of an embedded component, the component property name should be prepended to the property name when creating the `Restriction`.
@@ -217,15 +217,15 @@ List cats = session.createCriteria(Cat.class)
217217
.list();
218218
----
219219

220-
Note: this does not apply when querying collections of components, for that see below <<querycriteria-collections>>
220+
Note: this does not apply when querying collections of components, for that see below <<criteria-collections>>
221221

222-
[[querycriteria-collections]]
222+
[[criteria-collections]]
223223
=== Collections
224224

225225
When using criteria against collections, there are two distinct cases.
226226
One is if the collection contains entities (eg. `<one-to-many/>` or `<many-to-many/>`) or components (`<composite-element/>` ),
227227
and the second is if the collection contains scalar values (`<element/>`).
228-
In the first case, the syntax is as given above in the section <<querycriteria-associations>> where we restrict the `kittens` collection.
228+
In the first case, the syntax is as given above in the section <<criteria-associations>> where we restrict the `kittens` collection.
229229
Essentially we create a `Criteria` object against the collection property and restrict the entity or component properties using that instance.
230230

231231
For querying a collection of basic values, we still create the `Criteria` object against the collection,
@@ -240,7 +240,7 @@ List cats = session.createCriteria(Cat.class)
240240
.list();
241241
----
242242

243-
[[querycriteria-examples]]
243+
[[criteria-examples]]
244244
=== Example queries
245245

246246
The class `org.hibernate.criterion.Example` allows you to construct a query criterion from a given instance.
@@ -283,7 +283,7 @@ List results = session.createCriteria(Cat.class)
283283
.list();
284284
----
285285

286-
[[querycriteria-projection]]
286+
[[criteria-projection]]
287287
=== Projections, aggregation and grouping
288288

289289
The class `org.hibernate.criterion.Projections` is a factory for `Projection` instances.
@@ -385,7 +385,7 @@ List results = session.createCriteria(Cat.class)
385385
.list();
386386
----
387387

388-
[[querycriteria-detachedqueries]]
388+
[[criteria-detachedqueries]]
389389
=== Detached queries and subqueries
390390

391391
The `DetachedCriteria` class allows you to create a query outside the scope of a session and then execute it using an arbitrary `Session`.

0 commit comments

Comments
 (0)