I'm sorry, I just forgot the @Id property, heh. So I have it. I want that 2 to be not ID, but simply unique. Unique constraint on (apple_id, watermelon_id) that are foreign keys. Stupid isn't it? But, for my misery, this is what I want.
Joined: Jan 03, 2006
By the way, thanks for the link. JPA 1.0 or 2.0 Just don't know, I always thought that JPA is JPA without versions. By the way, I'm using Hibernate, so maybe it doesn't matter what JPA version it is. It's simple annotations isn't it?
subject: UniqueConstraint on foreign key (ManyToOne).