persistence@glassfish.java.net

Re: (TopLink Essentials) bogus _at_JoinTable default value

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Fri, 26 Oct 2007 08:18:38 -0400

Can you post the source for the mapping along with the SQL that TopLink
is generating?
 --Gordon

Klaus Unger wrote:
> Hi,
>
> I am using "TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007)" (from the
> latest GlassFish release).
>
> When using a very simple unidirectional OneToMany relation the @JoinTable
> default name value toplink behaves very strange.
> 1) On ddl create tables toplink tries to merge the join columns into the many
> side of the table and does not create an extra join table.
> 2) Inserting many-rows fails as the join-colums are not specified in the
> insert statement but are part of the PK of the table.
> 3) When accessing the relation toplink uses a bogus join table name
> like "app.app.CONTAINER_app.ELEMENT".
>
> Specifiying @JoinTable(name="CONTAINER_ELEMENT") on the relation makes toplink
> behave as I expect.
>
> However according to the standard:
> "If the JoinTable annotation is missing, the default values of the annotation
> elements apply."
> Which is for name: "The concatenated names of the two associated primary
> entity tables, separated by an underscore.", which should be
> CONTAINER_ELEMENT as app is the scheme and not part of the table name.
>
> Am I confusing something or is this a bug?
>
> Best Regards
> Klaus
>