Quote:
Do you have any other columns in the association table other than the foreign keys of the participating entities? If you dont , you could just map it as 2 Sets(one each from User and Group). Since its a Set, both the keys automatically form the composite-key and there is nothing to worry from a user's perspective. But if you have any extra columns, thats a different case. From your original posting, it looked like hibernate-tools created a table with composite-id, Do you have any extra columns (in addition to the foreign keys) in that table?
No, I don't have any other columns; just the two foreign keys. Yes the UserGroupTbl mapping file was generated by hibernate tools. When I tried removing composite-id from the mapping file it gave me this error:
Code:
The content of element type "class" must match
"(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,
(id|composite-id),discriminator?,natural-id?,(version|
timestamp)?,(property|many-to-one|one-to-one|component|
dynamic-component|properties|any|map|set|list|bag|idbag|
array|primitive-array)*,((join*,subclass*)|joined-subclass*|
union-subclass*),loader?,sql-insert?,sql-update?,sql-
delete?,filter*,resultset*,(query|sql-query)*)".
So at least id or composite-id needs to be present in a mapping file. Or do I even need the mapping file at all for UserGroupTbl then?
Thanks
Budyanto