1

I want to know hql analog for SQL:

delete license from license, license_pool 
where license.license_pool_id = license_pool.license_pool_id 
    and license.school_id = 13 
    and license_pool.program_id = 1 
    and license.staff_member_id is null
Stefan Steinegger
  • 63,782
  • 15
  • 129
  • 193
psylocybe
  • 23
  • 6

1 Answers1

1

I know this is an old question, but here is your answer. This can be found in the documentation for hibernate in the "DML-style operations" section (which pertains to HQL updates and deletes).

  • In the from-clause, the FROM keyword is optional
  • There can only be a single entity named in the from-clause. It can, however, be aliased. If the entity name is aliased, then any property references must be qualified using that alias. If the entity name is not aliased, then it is illegal for any property references to be qualified.
  • No joins, either implicit or explicit, can be specified in a bulk HQL query. Sub-queries can be used in the where-clause, where the subqueries themselves may contain joins. The where-clause is also optional.
Ben Tidman
  • 2,129
  • 17
  • 30