From noreply at atlassian.com Mon Apr 23 08:40:05 2007 Content-Type: multipart/mixed; boundary="===============7874396345194232629==" MIME-Version: 1.0 From: Max Rydahl Andersen (JIRA) To: hibernate-issues at lists.jboss.org Subject: [hibernate-issues] [Hibernate-JIRA] Closed: (HBX-581) hibernate-reverse-engineering IDENTITY generator doesn't result in correct annotation Date: Mon, 23 Apr 2007 07:40:04 -0500 Message-ID: <178663757.1177332004860.JavaMail.j2ee@atlassian01.managed.contegix.com> --===============7874396345194232629== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-581?pa= ge=3Dcom.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Max Rydahl Andersen closed HBX-581. ----------------------------------- > hibernate-reverse-engineering IDENTITY generator doesn't result in correc= t annotation > -------------------------------------------------------------------------= ------------ > > Key: HBX-581 > URL: http://opensource.atlassian.com/projects/hibernate/b= rowse/HBX-581 > Project: Hibernate Tools > Issue Type: Bug > Components: reverse-engineer > Affects Versions: 3.1beta4 > Reporter: Matt Read > > My hibernate.reveng.xml contains the following: > > > > >
> This results in the following annotations on my @Id field when generating= annotated Java: > @GenericGenerator(name=3D"generator", strategy=3D"IDENTITY", paramete= rs =3D { } ) > @Id @GeneratedValue(generator=3D"generator") > @Column(name=3D"jouSID", unique=3Dtrue, nullable=3Dfalse, insertable= =3Dtrue, updatable=3Dtrue) > public Long getsID() { > return this.sID; > } > Which results in the following error at runtime: > org.hibernate.MappingException: could not instantiate id generator > at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGenerato= rFactory.java:97) > at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleVal= ue.java:152) > at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:= 181) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav= a:1176) > at com.catlin.architecture.dao.hibernate.HibernateUtil.(Hibernat= eUtil.java:80) > at com.catlin.insuranceledger.JournalTest.setUp(JournalTest.java:38) > at junit.framework.TestCase.runBare(TestCase.java:125) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot= eTestRunner.java:478) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest= Runner.java:344) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes= tRunner.java:196) > Caused by: org.hibernate.MappingException: could not interpret id generat= or strategy: IDENTITY > at org.hibernate.id.IdentifierGeneratorFactory.getIdentifierGeneratorCla= ss(IdentifierGeneratorFactory.java:108) > at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGenerato= rFactory.java:91) > ... 15 more > Replacing the generated annotation with the following works fine: > @Id > @GeneratedValue(strategy=3DGenerationType.IDENTITY) > @Column(name=3D"jouSID", unique=3Dtrue, nullable=3Dfalse, insertable= =3Dtrue, updatable=3Dtrue) > public Long getsID() { > return this.sID; > } -- = This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira =20 --===============7874396345194232629==--