Is it possible to access the relationship table when doing HQL statement?
As an example, I have 3 tables: account, commitment, account_commitment. It was generated using these domains:
class Account {
static hasMany = [ commits : Commitment ]
String name
}
class Commitment {
static hasMany = [ actors : Account ]
String description
}
My final and actual SQL query is something like this:
SELECT
b.id,
account_name,
d.nid,
d.title
FROM
account_commitment a, // is this available in HQL?
account b,
commitment c,
content_type_act d
where
d.nid = 3332
and a.account_id = b.id
and a.act_id = c.id
and c.act_id = d.nid
I believe HQL only allows valid class domains. Since the relationship table is automatically generated, is this possible in HQL?
Thanks.