[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3707) Generate wrong CRUD SQL for joined-subclasses of union-subclass

David Wang (JIRA) noreply at atlassian.com
Tue Jan 13 03:34:38 EST 2009


Generate wrong CRUD SQL for joined-subclasses of union-subclass
---------------------------------------------------------------

                 Key: HHH-3707
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3707
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.6
         Environment: Hibernate V3.2.6, Oracle 11g
            Reporter: David Wang
         Attachments: src.zip

We use extension table to customerize our base line. Create one joined-subclass to the existed union-subclass in the project. For simple, I create simple sample to demo the error. UnionTableOne and UnionTableTwo are union-subclass of UnionTable. UnionTableOneExt is joined-subclass  of UnionTableOne. See the attached files. Here list the hebernate mapping file.
<hibernate-mapping package="union">
  <class name="UnionTable" entity-name="UnionTable" abstract="true">
    <id name="unionId" type="java.lang.Integer">
      <column name="UNION_ID" />
      <generator class="assigned" />
    </id>
  </class>
  <union-subclass name="UnionTableOne" extends="UnionTable" entity-name="UnionTableOne" table="uniontableone">
    <property name="oneName" column="ONE_NAME"></property>
  </union-subclass>
  <union-subclass name="UnionTableTwo" extends="UnionTable" entity-name="UnionTableTwo" table="uniontabletwo">
    <property name="twoName" column="TWO_NAME"></property>
  </union-subclass>
  <joined-subclass name="UnionTableOneExt" extends="UnionTableOne" entity-name="UnionTableOneExt" table="uniontableone_ext">
  <key column="UNION_ID"></key>
    <property name="extName" column="EXT_NAME"></property>
  </joined-subclass>
</hibernate-mapping>

When I create one UnionTableOneExt object, the generated SQL is 
      insert into uniontableone_ext (ONE_NAME, EXT_NAME, UNION_ID) values (?, ?, ?);

-- 
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

        



More information about the hibernate-issues mailing list