I suggest to use the table and it's default explanations for the annotations details. E.g. for the JoinColumn the 'name' refers to the FK column name in this table (i.e. table that this side is mapped to), and the 'referencedColumnName' to the PK column on the other side.
Please keep in mind that if you use TopLink Essentials (the default persistence provider in GlassFish), it converts all column names that it calculates by the default rules to [b]upper case[/b] . So be careful to match those names if you provide only partial mappings.
On the other hand, if you let the provider generate the DDL for you, you don't need to specify any mapping, unless a resulting name is a reserved SQL word.
HTH,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=215121