Java Reference
In-Depth Information
DELETE
[FROM] path [[AS] alias]
[WHERE logicalExpression]
path is the fully qualified name of an entity. The alias names may be used to abbreviate
references to specific entities or their properties, and must be used when property names
used in the query would otherwise be ambiguous.
INSERT
An HQL INSERT cannot be used to directly insert arbitrary entities—it can only be used to
insert entities constructed from information obtained from SELECT queries (unlike ordinary
SQL, in which an INSERT command can be used to insert arbitrary data into a table, as well as
insert values selected from other tables). Here's the syntax of the INSERT statement:
INSERT
INTO path ( property [, ...])
select
path is the fully qualified name of an entity. The property names are the names of proper-
ties of entities listed in the FROM path of the incorporated SELECT query.
The select query is an HQL SELECT query (as described in the next section).
SELECT
An HQL SELECT is used to query the database for classes and their properties. As noted previ-
ously, this is very much a summary of the full expressive power of HQL SELECT queries—
however, for more complex joins and the like, you may find that the use of the Criteria API
described in the next chapter is more appropriate. Here's the syntax of the SELECT statement:
[SELECT [DISTINCT] property [, ...]]
FROM path [[AS] alias] [, ...] [FETCH ALL PROPERTIES]
WHERE logicalExpression
GROUP BY property [, ...]
HAVING logicalExpression
ORDER BY property [ASC | DESC] [, ...]
path is the fully qualified name of an entity. The alias names may be used to abbreviate
references to specific entities or their properties, and must be used when property names used
in the query would otherwise be ambiguous.
The property names are the names of properties of entities listed in the FROM path.
If FETCH ALL PROPERTIES is used, then lazy loading semantics will be ignored, and all the
immediate properties of the retrieved object(s) will be actively loaded (this does not apply
recursively).
When the properties listed consist only of the names of aliases in the FROM clause, the
SELECT clause can be omitted.
Search WWH ::




Custom Search