From: <leg...@at...> - 2003-06-11 13:05:18
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 11 Jun 2003 8:03 AM This was fixed, I think. Would someone please verify that ... and re-open this issue if it is not. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-7 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-7 Summary: Oracle "Paging Select" w/association problem Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.0 final Versions: 2.0rc2 Assignee: Gavin King Reporter: Dave White Created: Wed, 30 Apr 2003 9:06 PM Updated: Wed, 11 Jun 2003 8:03 AM Description: I have a mapping that looks like this: <class name="Foo" proxy="Foo" table="Tbl_Foo" dynamic-update="true"> <composite-id name="fooKey" class="FooKey"> <key-property name="barId" column="barID" type="int"/> <key-property name="id2" column="ID2" type="int"/> </composite-id> <property name="location" column="Location" type="string"/> <many-to-one name="barRef" class="Bar" cascade="none" insert="false" update="false"> <column name="barID"/> </many-to-one> </class> As you can see, the the id of Foo is the same as the foreign key used in the many-to-one association to Bar. I've used the insert/update attributes to say that the barID column should not be include (twice) in the insert/update statements. However, when I do a query against this class the generated SQL contains the barID column twice in the select statement. Once for the composite-id, and once for the many-to-one association. This became a problem when I applied my "paging select" patch for Oracle which looks like this: select * from (select a.*, rownum rnum from ( <hibernate-generated-sql> ) a where rownum <= ?) where rnum >= ? The reason this is a problem is that when the <hibernate-generated-sql> statement contains the same column twice in the select clause, Oracle complains about ambiguously declared columns. I'm wondering if different aliases could be generated in the SQL for columns defined in composite-id vs. property vs. many-to-one? I did look into the <key-many-to-one> tag in the composite-id, but that didn't fit well with my (already-in-place/legacy) object model. --------------------------------------------------------------------- JIRA INFORMATION: 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/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |