We're updating the issue view to help you get more done. 

Error in documentation sample code about JPQL and HQL

Description

In 15.17. Collection member references of documentation, in example Example 495. Collection references example the second query is not equivalent to first query because of the select clause.

In the first query select clause selects ph which is a reference to Phone entity, but in second one the select clause selects pr which is a reference to Person.

The second query should be changed to

1 2 3 4 5 6 7 8 9 10 List<Phone> phones = session.createQuery( "select ph " + "from Person pr, " + "in (pr.phones) ph, " + "in (ph.calls) c " + "where pr.address = :address " + " and c.duration > :duration" ) .setParameter( "address", address ) .setParameter( "duration", duration ) .list();

Status

Assignee

Vlad Mihalcea

Reporter

Amir Pashazadeh

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.3.1

Priority

Major