nobody should say that NH really give support to composite-ids ;) On Tue, Feb 22, 2011 at 4:05 PM, Francois Ward <[email protected]>wrote:
> I'm not sure I understand the requirement, but just in case it helps: > > I have a project dealing with an extremely legacy/denormalized database > with huge composite natural keys... I've been having success using composite > id with a mix of key-property and key-many-to-one in my mappings, to map > relations and keys that use arbitrary amount of columns. > > Maybe that could apply to your scenario? > > > On Tue, Feb 22, 2011 at 11:38 AM, Stuart Carnie > <[email protected]>wrote: > >> Thanks for the reply, Fabio. I have already advised them to consider a >> surrogate key, but it is a legacy database that I do not have any control >> over. >> >> The problem I can see with <properties>, is that as per the Hibernate >> documentation<http://docs.jboss.org/hibernate/core/3.3/reference/en/html/mapping.html#mapping-declaration-properties> >> : >> >> The <properties> element allows the definition of a named, logical >> grouping of the properties of a class. The most important use of the >> construct is that it allows a combination of properties to be the target of >> a property-ref. It is also a convenient way to define a multi-column unique >> constraint. >> >> >> Unfortunately, this is an overloaded feature, meaning the creation of the >> <properties> group is also used to *define* the mapped properties. That >> is, they cannot be used in more than one grouping. I read it as “if >> property *x* is defined in set A, it cannot be defined in set B” >> >> Cheers, >> >> Stuart >> >> -- >> 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. >> > > -- > 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. > -- Fabio Maulo -- 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.
