tags:

views:

1237

answers:

2

Which, I couldn't quite figure out why Eclipse Galileo's JPA validator would say so, as my class 'X' clearly had an @Id annotation on the primary key "uniqueId". The error would disappear if I commented out the @Basic annotation line, but that didn't quite make sense. Anyway, attaching snippet below from memory:

@Entity
class X {
...
@Id
@Basic(optional=false)
@Column(name="someUniqueId", unique=false)
String uniqueId;
...
}

Is this a bug, or is there a JPA standard which I'm not aware of on the use of annotations?

+1  A: 

You have here a similar case which may suggest a case or type issue.

But as mentioned here, I would rather bet on bug 217192 (which can be comared with the "non-bug" 208249)

You can also specify which version of eclipse and Dali JPA Tool you are using.

VonC
Eclipse 3.5 Galileo, and Dali 2.2. Seems bug #217192 isn't the same as mine, as it only applies to subclasses inheriting IDs. I'll probably file a new bug after this. :P
Jerry Chong
@Jerry Good idea. You can also post it here, and select your answer as the official one if you want.
VonC
A: 
@EmbeddedId
String uniqueId;