persistence@glassfish.java.net

Re: Self-referencing manytomany relationship

From: Pramod Gopinath <Pramod.Gopinath_at_Sun.COM>
Date: Wed, 28 Jun 2006 15:22:20 -0700

Hi Benjamin
   Yes you are correct. There is a bug in the current code for
self-referencing many-to-many relationship in the java2db side. We only
create a table with one column. Could you go ahead and file an issue
for this.

Thanks
Pramod

Benjamin Graf wrote:
> Hi,
>
> does anybody know how to implement a Self-referencing manytomany relationship? I tried this example:
>
> @ManyToMany(cascade=CascadeType.ALL)
> private Collection<BoEntity> relation;
>
> But I got only a table boentity_boentity with one column id_relation. I think need something with two columns.
>
> Can anybody help me?
>
> Best regards
> Benjamin
>