Hello
I try to compare a relation with an already-loaded persistent object
in HQL, where ids of the objects are multi-column ids (hibernate 2.0.3).
Here is the declaration of id (no composite-id, because need to have
a custom type to manage my id and composite-id do not have a type
attribute) :
<id name="key" type="test.hibernate.IRKeyType">
<column name="classId"/>
<column name="id" />
<generator class="test.hibernate.IRKeyGenerator">
<param name="classId">1024</param>
</generator>
</id>
The following HQL fails with a 'path expression ends in a composite value' :
"from test.hibernate.Dumb as res where res.linked=?"
where I called setEntity(0, linkedObject) in the Query (linkedObject
being another persistent object of the same class).
As columns cannot be named in a <id> (while they can be named in
<composite-id>) I cannot do something like 'where res.linked.key.id=?'
as it is suggested in the doc for composite-id. As I need custom type
for my id, I cannot use composite-id neither.
Is it possible to make this thing work, or does it need a modification in
the way Hibernate parses equality in HQL, allowing composite values
to be compared ?
Thanks in advance for any advice.
Emmanuel Ligne
|