Hi,
I have the problem with the following mapping situation. There are 2 tables:
Table a:
Code:
+--------------------------------------+
| PRIMKEY | FIELD1 | FIELD 2 | FIELD 3 |
+--------------------------------------+
| INT | String | String | String |
+--------------------------------------+
Table b:
Code:
+-----------------------------------------+
| PRIMKEY1 | PRIMKEY2 | PRIMKEY3 | FIELD |
+-----------------------------------------+
| String | String | String | String |
+-----------------------------------------+
The primary key of table b is mapped as a composite-id. Now I want to join the 2 tables like in the following SQL.
Code:
SELECT * FROM a LEFT OUTER JOIN b ON a.field2=b.primkey1 AND b.primkey2=someval AND b.primkey3=someotherval;
I've tried various associations, but they all seem to require a real foreign key association, which is not possible, as table a doesn't have a direct relationship to primkey2 and primkey3 of table b. I've also tried sets and other collection mappings, but there seems to be no obvious way to do this. The doc doesn't explain too much about situations like this.
Is there anyone who can point me to the right direction?