-->
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.  [ 3 posts ] 
Author Message
 Post subject: Annotations - IDE problems
PostPosted: Wed Jul 12, 2006 7:42 pm 
Newbie

Joined: Wed Jul 12, 2006 7:35 pm
Posts: 2
Hi All
I am new to Hibernate/EJB3 Annotations and currently I am working on a small toy app combining Spring,Hibernate Annotations. I have deployed the app successfully, but after removing some annotations. If I put those annotations back, it wont even compile from eclipse 3.2(the latest version I belive).

This is the annotation I am planning on originally and since it doesnt compile, I took it out to just go ahead with teh deployment.

@Id(generate=GeneratorType.AUTO)
public int getId() {
return id;
}

But this annotation does compile though!
@Column (length=100)
public String getName() {
return name;
}

So the error message from the IDE I get (its always red high lighted!)
GeneratorType cannot be resolved
The attribute generate is undefined for the annotation type Id

So any pointers on solving this annoying bug is higly appreciated. I have been frustrated for the past 2 days sicne even after enough googling I havent been able to solve it myself.

Thanks

_________________
Ramesh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 7:57 pm 
Newbie

Joined: Wed Jul 12, 2006 7:35 pm
Posts: 2
I just changed my original annotation to the below mentioned annotation and things look bright sudenly. So was the original annotation illegitamate?

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() {

return id;
}

Thanks

_________________
Ramesh


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 3:31 am 
Newbie

Joined: Wed Jun 21, 2006 5:46 am
Posts: 10
Location: Finland
The first one was valid annotation in EJB3 Public Draft specification, but it was changed in EJB3 Proposed Final, when GeneratedValue annotation was added to specification.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.