Skip to content

Commit f36f7a0

Browse files
committed
fix minor errors in queries in querylanguage doc
1 parent 4eee305 commit f36f7a0

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

documentation/src/main/asciidoc/querylanguage/Expressions.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ from Author where books is empty
11701170
[[member-of-collection-predicate-example]]
11711171
[source, hql]
11721172
----
1173+
select author, book
11731174
from Author as author, Book as book
11741175
where author member of book.authors
11751176
----

documentation/src/main/asciidoc/querylanguage/From.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Then Hibernate will query every entity which inherits the named type.
5353
[[root-reference-jpql-fqn-example]]
5454
[source, hql]
5555
----
56-
select doc from org.hibernate.example.AbstractDocument where text like :pattern
56+
select doc from org.hibernate.example.AbstractDocument as doc where doc.text like :pattern
5757
----
5858

5959
Of course, there may be multiple root entities.
@@ -349,6 +349,7 @@ An explicit join may narrow the type of the joined entity using `treat()`.
349349
from Order as ord
350350
join treat(ord.payments as CreditCardPayment) as creditCardPayment
351351
where length(creditCardPayment.cardNumber) between 16 and 20
352+
select ord.id, creditCardPayment.cardNumber, creditCardPayment.amount
352353
----
353354

354355
Here, the identification variable `ccp` declared to the right of `treat()` has the narrowed type `CreditCardPayment`, instead of the declared type `Payment`.

documentation/src/main/asciidoc/querylanguage/Relational.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ with Tree as (
942942
join Node child on child.parent.id = parent.id
943943
) search depth first by id set level /* depth-first search */
944944
from Tree
945+
select text
945946
order by level
946947
----
947948

@@ -962,6 +963,7 @@ with Tree as (
962963
join Node child on child.parent.id = parent.id
963964
) search breadth first by id set level /* breadth-first search */
964965
from Tree
966+
select text
965967
order by level desc
966968
----
967969

0 commit comments

Comments
 (0)