fix minor errors in queries in querylanguage doc

This commit is contained in:
Gavin King 2023-06-05 22:10:04 +02:00
parent 4eee30550c
commit f36f7a0885
3 changed files with 5 additions and 1 deletions

View File

@ -1170,6 +1170,7 @@ from Author where books is empty
[[member-of-collection-predicate-example]]
[source, hql]
----
select author, book
from Author as author, Book as book
where author member of book.authors
----

View File

@ -53,7 +53,7 @@ Then Hibernate will query every entity which inherits the named type.
[[root-reference-jpql-fqn-example]]
[source, hql]
----
select doc from org.hibernate.example.AbstractDocument where text like :pattern
select doc from org.hibernate.example.AbstractDocument as doc where doc.text like :pattern
----
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()`.
from Order as ord
join treat(ord.payments as CreditCardPayment) as creditCardPayment
where length(creditCardPayment.cardNumber) between 16 and 20
select ord.id, creditCardPayment.cardNumber, creditCardPayment.amount
----
Here, the identification variable `ccp` declared to the right of `treat()` has the narrowed type `CreditCardPayment`, instead of the declared type `Payment`.

View File

@ -942,6 +942,7 @@ with Tree as (
join Node child on child.parent.id = parent.id
) search depth first by id set level /* depth-first search */
from Tree
select text
order by level
----
@ -962,6 +963,7 @@ with Tree as (
join Node child on child.parent.id = parent.id
) search breadth first by id set level /* breadth-first search */
from Tree
select text
order by level desc
----