Hey,

I have a composite key to user table.

so i have class for the composite-id - UserID (first,second)

I have class XXX like this:
1- the same pk like user
2- many to one to user.

in the many-to-one to the user i use in joincolumns like this:
@JoinColumns( { @JoinColumn(name = "first",referencedColumnName="first", 
@JoinColumn(name = "second",referencedColumnName="second") })

i get an exception:
repeated column for column- first
The same clumns are the PK and FK.

Can you please advice. 

@Entity
  | public class Animal {       
  | @EmbeddedId PK pk = new PK();               
  | @ManyToOne  
  | @JoinColumns( { @JoinColumn(name = "first",referencedColumnName="first"), 
@JoinColumn(name = "second",referencedColumnName="second") })
  | Owner owner;
  | } 
  | 
  | @Entity
  | public class Owner {        
  | @EmbeddedId PK pk = new PK(); 
  | } 
  | 
  | public class PK implements Serializable{    
  | public String first;        
  | public String second;
  | }

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171625#4171625

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171625
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to