[
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira