Hi,
I think that the "name" attribute of the "@JoinColumn" denotes the
column name in your "User" table. The "referencedColumn" should be the
name of the primary key column in your child table.
So, to achieve your sql snippet, your relationship should be:
@OneToOne
| @JoinColumn(name="mycar_id",
| referencedColumnName="car_id")
| public Car getMyCar() ...
But normally the @OneToOne annotation should work without any @JoinColumn annotations. The
server will choose defaults for the column names. So, start with the easiest solution and
remove the @JoinColumn annotation ;-).
Hope this helps
Wolfgang
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217900#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...