Page 1 of 1

ManyToMany Assocation script generation

Posted: Mon 14 Feb 2011 16:06
by creaseypaul
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?

Posted: Tue 15 Feb 2011 13:51
by AndreyR
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.

Posted: Wed 16 Feb 2011 08:41
by creaseypaul
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 :)