HQL

Other topics

Remarks:

The main thing to remember when using hql is the use the class name and field names instead of the table and column names we are used to in SQL.

Selecting a whole table

hql = "From EntityName";

Select specific columns

hql = "Select id, name From Employee";

Include a Where clause

hql = "From Employee where id = 22";

Join

hql = "From Author a, Book b Where a.id = book.author";

Contributors

Topic Id: 9388

Example Ids: 29082,29083,29084,29085

This site is not affiliated with any of the contributors.