> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Brian
> Cochran
> Sent: 18. september 2002 02:39
> To: '[EMAIL PROTECTED]'
> Subject: [Middlegen-user] Many2Many and One2Many
>
>
> Hey All,
>
> When I specify many2many relationships the one2many relationships to the
> mapping table are still generated and although no entity is generated, the
> references to it are. For example:
>
> A *- C -* B representing a many2many between A and B. I am using the
> following
>
> <table name="A" generate="true" />
> <table name="B" generate="true" />
>
> <many2many>
>       <tablea name="A" generate="true" />
>       <jointable name="C" generate="false" />
>       <tableb name="B" generate="true" />
> </many2many>
>
> I create the database with
>
> CREATE TABLE A ( aId integer, ..., PRIMARY KEY(aId));
> CREATE TABLE B ( bId integer, ..., PRIMARY KEY(bId));
> CREATE TALBE C ( aId, bId, PRIMARY KEY(aId,bId),
>               FOREIGN KEY(aId) REFERENCES A,
>               FOREIGN KEY(bId) REFERENCES B );
>
> Middlegen will not create the entity C but it will not remove the
> one-to-many relation from C to A or vise-versa if the relationship is
> bidirectional. What I am wondering is why, after you have found the
> existance of a many2many, are the one2manys kept around. This has been

Just because an A-B is found doesn't necessarily mean A-C or B-C can be
removed. It all depends on whether C should be generated or not. The problem
was that the template didn't check for this. It does now, so if you CVS
update, it should work as expected.

If you set C to generate="false", you'll only get A-B.
If you set C to generate="true", you'll get A-B,A-C,B-C.

Thanks for reporting this issue!

Aslak

> causing me problems because the relationship between (A,B) and
> (C)  is still
> generated but the entity C does not exist.
>
> I'm looking at the last line of addMany2ManyRelationships and wondering if
> we couldn't add something in there to remove the one2many we just
> replaced.
> Let me know if I'm just missing something here.
>
> Thanks a bunch,
> Brian
>
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: AMD - Your access to the experts
> on Hammer Technology! Open Source & Linux Developers, register now
> for the AMD Developer Symposium. Code: EX8664
> http://www.developwithamd.com/developerlab
> _______________________________________________
> middlegen-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/middlegen-user



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to