2010/9/3 Frans Bouma <[email protected]> > I hadn't looked at id-bag. When I change it, it indeed works. There > is a downside to this though: if the intermediate entity has a compound PK, > it won't work. Admitted that's an edge case, but it's still odd. >
It's not only an edge case, but an impossible case. How do you think that nhibernate will generate the composite pk for the items when inserting? Its not even supported an assigned id. > What's more > odd is that the .xsd suggests that <collection-id> accepts child <column> > elements, however it also requires a column + type (why?) attributes, > suggesting that <column> child elements are not really part of the 'key'. > > The whole thing feels inconsistent: <key> inside <set> suggests that > the PK is defined with that, so that's re-defining the pk, which is bad (it > creates this problem), > Because "key" means the key of the entity where the collection is contained, it is not the Primary Key of the intermediate table... Never the "key" is the PK. however <collection-id> in <idbag> re-defines the PK of the intermediate entity again as well, while it's already defined in the intermediate entity's mapping itself. It is a conceptual problem. I have never maped a single table in two differents places like that.... I think you are doing it wrong. It is true that nhibernate does not do nothing with that information, lets said nhibernate doesn't guess the collection id, doesn't look for another entity with the same table name, and so on. Also, I think that an SchemaExport will fail badly. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
