Hibernate version: 3.1.2
Name and version of the database you are using: Oracle 9
Hello,
I have 2 classes A and B related through a bidirectional on-many relationship. A contains a Set mapping with inverse="true" referencing B, B contains a many-to-one mapping referencing A.
Now, when I do a query
Code:
select a from A a join fetch a.bs where a.name = 'test'
I get the As with the bs relationship resolved as expected.
However, when I do something like
Code:
select a from A a join fetch a.bs where exists (select b2 from B b2 where b2.a = a and b2.number = 22)
I get a number of A instances that corresponds to the expected number multiplied by the number of related B instances, i.e. the rows returned by the underlying SQL are not resolved to unique A instances, making the query useless.
can somebody comment on this?
thanks,
Christian[/quote]