-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: No identifier specified for entity
PostPosted: Mon Oct 17, 2005 11:03 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo together,
using the annotation @EmbeddableSuperclass i get the following error message.
I would be really glad about help!

Hibernate version:
Hibernate3 RC1
Hibernate Annotations 3.1 beta 6

Code extracts:
Code:
import javax.persistence.*;

/**
* @archetype PartyPlaceThing
* generated code by ACG
*/
@EmbeddableSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class _Wohnort
{
    @Id(generate=GeneratorType.AUTO)
    private int primaryKey;
.
.
.
.

}


Code:
package assocTest;
import javax.persistence.*;

@Entity(access = AccessType.FIELD)
public class Wohnort extends _Wohnort {
   public Wohnort (){
       super();
   }
.
.
.
.
}



Full stack trace of any exception that occurs:
ERROR - could not complete schema update
org.hibernate.AnnotationException: No identifier specified for entity: assocTest.Wohnort
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:256)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:191)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:817)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:144)
at main.HibernateUtil.<clinit>(HibernateUtil.java:36)
at testcases.AssocTestCase.setUp(AssocTestCase.java:82)
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(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
Initial SessionFactory creation failed.org.hibernate.AnnotationException: No identifier specified for entity: assocTest.Wohnort
INFO - cleaning up connection pool: jdbc:mysql://127.0.0.1/praktikum
INFO - duplicate import: assocTest.Wohnort->Wohnort


Regards,
Martin


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 3:05 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
@EmbeddableSuperclass(access=AccessType.FIELD)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 6:24 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hi Emmanuel,
thank you for the hint, but i tried this one, too, just getting another exception:

ERROR - could not complete schema update
org.hibernate.AnnotationException: Unable to find entity assocTest._Person
at org.hibernate.cfg.AnnotationBinder.bindFkSecondPass(AnnotationBinder.java:1636)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:32)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:214)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:817)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:144)
at main.HibernateUtil.<clinit>(HibernateUtil.java:36)
at testcases.AssocTestCase.setUp(AssocTestCase.java:82)
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(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
INFO - cleaning up connection pool: jdbc:mysql://127.0.0.1/praktikum
Initial SessionFactory creation failed.org.hibernate.AnnotationException: Unable to find entity assocTest._Person


The entity assocTest._Person hat the same annotations like the other classes and existst of course.... :
Code:
@EmbeddableSuperclass(access=AccessType.FIELD)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class _Person
{
   .
   .
   .
}


Hope, someone of you has an idea.

Regards,
Martin


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 6:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
do not use the superclass name, use a regular entity name

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 1:41 am 
Newbie

Joined: Tue Sep 13, 2005 10:57 pm
Posts: 10
pls change to @Id(...=generatorType.TABLE)
for table_per_class strategy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 3:34 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo,
thank for you help!
Now it works!

Regards,
Martin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.