From: Martin S. (JIRA) <no...@at...> - 2006-05-26 03:41:15
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1788?page=all ] Martin Schulz updated HHH-1788: ------------------------------- Attachment: HHH-1788 Patch This patch detects the scenario (Backref Property with column of same name in the entity's key columns), and then marks the Backref as not insertable. This has the desired effect of a) passing the duplicate checking b) generate the correct insert Object array > 1-m Collections were the FK is part of a composite PK fail with duplicate column check > -------------------------------------------------------------------------------------- > > Key: HHH-1788 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1788 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.2.0.cr2 > Environment: 3.2.0 > Sybase ASE > Reporter: Martin Schulz > Attachments: HHH-1788, ParentChild_1.hbm.xml > > > This is a very simple use case. > Assume tables Parent and Child (no inheritance) where the Child has a composite PK (parentID, childNumber). > See a simple sample mapping attached. > Both the key element for the collection and the composite key are required, but the duplicated column is caught and > rejected. At the core of the issue is the key element of the collection, which in my mind should be declarative and > need not represent a mapped column... however adressing that would become a major compatibility issue, so > a simpler patch is in order. > There are many different possible strategies to address this, but the patch I have used successfully is minimal > and benign, if limited to the exact scenario at hand. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |