-->
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: Tue May 02, 2006 8:03 am 
Newbie

Joined: Tue May 02, 2006 7:51 am
Posts: 3
Yes, I've searched for this error before but not found anything I could relate to.

I get the exception:
Quote:
org.hibernate.AnnotationException: No identifier specified for entity


The class is auto-generated by NetBeans:
Code:
@Entity
@Table(name = "PDFINSTALLEDFONTS")
public class Pdfinstalledfonts {

    @Id
    @Column(nullable = false)
    private BigDecimal id;
(..)


I read in the Hibernate FAQ that the reason for this error was that the unique id field wasn't annotated with @Id .. but it is in my case.

Anyone know what else might be the reason?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 3:49 am 
Newbie

Joined: Tue May 02, 2006 7:51 am
Posts: 3
*bump*

anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 3:55 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Hmmm .... all of my entities have an id generator specified.
How do you generate your id's?

If by autoincrement - try adding this annotation:
Code:
@GeneratedValue


Else update Hibernate stuff to the latest and debug AnnotationConfiguration buildup.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 3:57 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Hmmm .. why a BigDecimal id field?

What about plain Long or Integer?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 7:11 am 
Newbie

Joined: Tue May 02, 2006 7:51 am
Posts: 3
thanks for the input alesj :) .. I've tried with Long and Integer, and also added @GenerationValue (it's no longer called @GeneratedValue for some reason, spent a couple of hours on that.)

Quote:
Else update Hibernate stuff to the latest and debug AnnotationConfiguration buildup.

hmm, this is a bit over my head - "debug AnnotationConfiguration buildup"?

I'm using JBoss 4.0.4 CR2, but I'm unsure of what hibernat version it includes..


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 2:20 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Show the full object, there is no reason why it should fail

_________________
Emmanuel


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.