ManyToMany Assocation script generation

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
creaseypaul
Posts: 11
Joined: Mon 14 Feb 2011 15:56

ManyToMany Assocation script generation

Post by creaseypaul » Mon 14 Feb 2011 16:06

I have a many to many relation, where the two primary keys have the same name (ID).

Code: Select all

CREATE TABLE FLASH(
ID NUMBER
)
CREATE TABLE REGION(
ID NUMBER
)
Entity developer generates the following manytomany link table:

Code: Select all

CREATE TABLE "flash"."Regions_Flashes" (
   ID NUMBER(9) NOT NULL,
   ID NUMBER(9) NOT NULL,
   CONSTRAINT "PrimaryKey" PRIMARY KEY (ID, ID),
   CONSTRAINT "FK_Regions_Flashes_Regions" FOREIGN KEY (ID) REFERENCES "Regions" (ID),
   CONSTRAINT "FK_Regions_Flashes_Flashes" FOREIGN KEY (ID) REFERENCES "Flashes" (ID)
);
which is invalid, obviously.

In the manytomany associations dialog, at the bottom, i specified values for the Column field, which i thought would rename these fields, but it didn't.

Any way to fix this automatically, or do i need to manually add these entities or rename my PK's?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 15 Feb 2011 13:51

I have just performed a simple model first test using the latest 6.10.103 build of dotConnect for Oracle, and the generated join table contained ID and ID1 fields.

creaseypaul
Posts: 11
Joined: Mon 14 Feb 2011 15:56

Post by creaseypaul » Wed 16 Feb 2011 08:41

I see this problem in Entity Developer 3.20.74, using oracle 10gR2 and generating a script rather than directly updating the db.

I've renamed all the PK's now so no drama :)

Post Reply