From: Lauri V. (JIRA) <no...@at...> - 2006-08-03 14:37:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-584?page=comments#action_23826 ] Lauri Vasko commented on HBX-584: --------------------------------- two default constructors are generated in case when hibernate.reveng.xml defines generator class for tables' primary-key like so: <hibernate-reverse-engineering> <table name="SUBBJEKTIDE_SEOS"> <primary-key> <generator class="acme.TableNameSequenceGenerator"> </generator> </primary-key> </table> </hibernate-reverse-engineering> AND when you have composite-id for that table (*.hbm.xml wold look something like that): <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated 3.08.2006 16:31:03 by Hibernate Tools 3.2.0.beta6a --> <hibernate-mapping> <class name="acme.SubjektideSeos" table="SUBJEKTIDE_SEOS"> <composite-id name="id" class="acme.SubjektideSeosId"> <key-many-to-one name="subjektideSeoseLiik" class="acme.SubjektideSeoseLiik"> <column name="SUBJEKTIDE_SEOSE_LIIK_ID" precision="22" scale="0" /> </key-many-to-one> <key-many-to-one name="subjekt1" class="acme.Subjekt"> <column name="SUBJEKT1_ID" precision="22" scale="0" /> </key-many-to-one> <key-many-to-one name="subjekt2" class="acme.Subjekt"> <column name="SUBJEKT2_ID" precision="22" scale="0" /> </key-many-to-one> </composite-id> <property name="ametikoht" type="string"> <column name="AMETIKOHT" length="100" /> </property> </class> </hibernate-mapping> and version of Hibernate Tools is as shows the autogenerated comment 3.2.0.beta6a. Indeed this is case of misuse, because there is no need to define generator for composite-id (at least one didn't get generated into hbm.xml -- as you see above). Nevertheless, misuse or not, Hibernate Tools should generate .java files that compile. > hbm2java creates two default constructors > ----------------------------------------- > > Key: HBX-584 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-584 > Project: Hibernate Tools > Type: Bug > Components: hbm2java > Versions: 3.1beta4 > Reporter: shabs shabalot > Priority: Minor > > > hbm2java creates two default constructors when the mapping file has just one field. > http://forum.hibernate.org/viewtopic.php?t=955225 -- 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 |