Professional Documents
Culture Documents
b) Mapping XML
<hibernate-mapping>
</hibernate-mapping>
2. Explain following clause in HQL (Hibernate Query Language.)
a. Select
b. where
c. update
Ans:
a) An HQL SELECT is used to query the database for classes and their
properties. 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] [, ...]
b) Where Clause is used to limit the results returned from database. It can be
used with aliases and if the aliases are not present in the Query, the
properties can be referred by name. For example:
from UserDetails user where user.userId = 3