[hibernate-issues] [Hibernate-JIRA] Closed: (HBX-723) hbm2doc shows abstract classes as tables

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Thu Sep 21 02:50:24 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-723?page=all ]
     
Max Rydahl Andersen closed HBX-723:
-----------------------------------

    Fix Version: 3.2beta8
     Resolution: Fixed

fixed - thanks for reporting it.

> hbm2doc shows abstract classes as tables
> ----------------------------------------
>
>          Key: HBX-723
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-723
>      Project: Hibernate Tools
>         Type: Bug

>   Components: hbm2doc
>     Versions: 3.2beta6
>  Environment: Hibernate 3.2 cr3, Oracle database, Windows machine, Ant 1.6..5
>     Reporter: Jeff
>     Priority: Minor
>      Fix For: 3.2beta8

>
>
> Take for example an abstract class Person and a class that extends Person called User. Mapped in one mapping file using <union-subclass>.
> <hibernate-mapping package="crown.core.domainobjects">
>     <class name="Person" abstract="true">  
>         <cache usage="read-write" /> 
>         <id name="id" type="long">
>             <column name="PERSON_ID">
>                 <comment>the primary key for hibernate</comment>
>             </column>
>             <generator class="sequence">
>                 <param name="sequence">PERSON_SEQ</param>
>             </generator>
>         </id>
>         
>         <property name="firstName" type="string">
>             <column name="FIRST_NAME" length="50" not-null="true">
>                 <comment>the first name</comment>
>             </column>
>         </property>
>         <union-subclass name="User" table="CROWN_USERS" lazy="false">
>             <comment>Table of crown users</comment>
>             <property name="userName" type="string">
>                 <column name="USER_NAME" length="15" not-null="true" unique="true">
>                     <comment>the unique user id</comment>
>                 </column>
>             </property>
>         </union-subclass>
> </hibernate-mapping>
> When the hbm2doc ant task is executed it will list the CROWN_USERS table with the columns mapped for both Person and User correctly. However, it will also list a table Person with all the columns mapped in Person even though it isn't actually a table in the database. The <<hbm2ddl> task works correctly and does not create a Person table.

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