From: wanhing (JIRA) <no...@at...> - 2006-08-02 05:40:13
|
hbm2java generate wrong class description when there is common scope class description -------------------------------------------------------------------------------------- Key: HBX-717 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-717 Project: Hibernate Tools Type: Bug Components: ant Versions: 3.2beta6 Environment: Window XP, java, Jboss Reporter: wanhing Priority: Critical I have the following mapping definition: ============================================================================================ <meta attribute="class-description"> @author Hibernate CodeGenerator </meta> <class name="Product"> <meta attribute="class-description" inherit="false"> @jboss-net.xml-schema urn="tms:Product" </meta> <id name="id" column="ProductId" type="long" > <generator class="native"/> </id> <version name="version" /> <property name="name" type="string" length="40" not-null="true" column="product"/> </class> <class name="ExpenseMethod"> <meta attribute="class-description"> @jboss-net.xml-schema urn="tms:ExpenseMethod" </meta> <id name="id" column="ExpenseMethodId" type="long" > <generator class="native"/> </id> <version name="version" /> <property name="name" type="string" length="15" not-null="true" column="expensemethod"/> </class> <class name="CostCenter"> <meta attribute="class-description"> @jboss-net.xml-schema urn="tms:CostCenter" </meta> <id name="id" column="CostCenterId" type="long" > <generator class="native"/> </id> <version name="version" /> <property name="name" type="string" length="40" not-null="true" column="costcenter"/> </class> ================================================================================== Note that I have a <meta attribute="class-description"> defined outside any class and also one that defined inside each class. This resulted a wrong class annotation in all the generated files as follows: ======================================================================================= package com.adis.service.timesheet; // Generated 2/08/2006 17:36:09 by Hibernate Tools 3.2.0.beta6a /** * @author Hibernate CodeGenerator * * @jboss-net.xml-schema urn="tms:Product" * * @jboss-net.xml-schema urn="tms:ExpenseMethod" * * @jboss-net.xml-schema urn="tms:ExpenseMethod" * * @jboss-net.xml-schema urn="tms:CostCenter" * * @jboss-net.xml-schema urn="tms:CostCenter" * */ public class Product implements java.io.Serializable { ... } =================================================================== As you can see above the all the individual class description are joint together and there is also a duplicate for each class description. This problem doesn't exist if I don't have the common class description outside the classes. -- 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 |
From: Max R. A. (JIRA) <no...@at...> - 2006-08-02 16:04:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-717?page=all ] Max Rydahl Andersen closed HBX-717: ----------------------------------- Fix Version: 3.2beta7 Resolution: Duplicate > hbm2java generate wrong class description when there is common scope class description > -------------------------------------------------------------------------------------- > > Key: HBX-717 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-717 > Project: Hibernate Tools > Type: Bug > Components: ant > Versions: 3.2beta6 > Environment: Window XP, java, Jboss > Reporter: wanhing > Priority: Critical > Fix For: 3.2beta7 > > > I have the following mapping definition: > ============================================================================================ > <meta attribute="class-description"> > @author Hibernate CodeGenerator > </meta> > <class name="Product"> > <meta attribute="class-description" inherit="false"> > @jboss-net.xml-schema urn="tms:Product" > </meta> > <id name="id" column="ProductId" type="long" > > <generator class="native"/> > </id> > <version name="version" /> > <property name="name" type="string" length="40" not-null="true" column="product"/> > </class> > <class name="ExpenseMethod"> > <meta attribute="class-description"> > @jboss-net.xml-schema urn="tms:ExpenseMethod" > </meta> > <id name="id" column="ExpenseMethodId" type="long" > > <generator class="native"/> > </id> > <version name="version" /> > <property name="name" type="string" length="15" not-null="true" column="expensemethod"/> > </class> > <class name="CostCenter"> > <meta attribute="class-description"> > @jboss-net.xml-schema urn="tms:CostCenter" > </meta> > <id name="id" column="CostCenterId" type="long" > > <generator class="native"/> > </id> > <version name="version" /> > <property name="name" type="string" length="40" not-null="true" column="costcenter"/> > </class> > ================================================================================== > Note that I have a <meta attribute="class-description"> defined outside any class and also one that defined inside each class. This resulted a wrong class annotation in all the generated files as follows: > ======================================================================================= > package com.adis.service.timesheet; > // Generated 2/08/2006 17:36:09 by Hibernate Tools 3.2.0.beta6a > /** > * @author Hibernate CodeGenerator > * > * @jboss-net.xml-schema urn="tms:Product" > * > * @jboss-net.xml-schema urn="tms:ExpenseMethod" > * > * @jboss-net.xml-schema urn="tms:ExpenseMethod" > * > * @jboss-net.xml-schema urn="tms:CostCenter" > * > * @jboss-net.xml-schema urn="tms:CostCenter" > * > */ > public class Product implements java.io.Serializable { > ... > } > =================================================================== > As you can see above the all the individual class description are joint together and there is also a duplicate for each class description. > This problem doesn't exist if I don't have the common class description outside the classes. -- 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 |