Professional Documents
Culture Documents
HQL - 3
HQL - 3
Note that these last two queries will require more than one SQL . This means that the clause
does not correctly order the whole result set.
In order to use non-mapped base classes or interfaces in HQL queries, they have to be imported. See Sec-
tion 5.1.23, “import” for more information.
will return all instances of for which there exists an instance of with a property equal to the
property of the . Compound path expressions make the clause extremely powerful. Con-
sider:
This query translates to an SQL query with a table (inner) join. If you were to write something like
you would end up with a query that would require four table joins in SQL.
The operator may be used to compare not only properties, but also instances:
The special property (lowercase) may be used to reference the unique identifier of an object. (You may also
use its property name.)
Properties of composite identifiers may also be used. Suppose has a composite identifier consisting of
and .