One to One Association Problem
Posted: Wed 16 Nov 2011 14:57
Hi there,
I'm trying to create a one to one association with two tables but i keep getting FK constraint error. I've tried to change my association to one to many and the exact same model worked. So, I came here for help.
Here are my tables (they were modified to be tested easily)
I've looked at the sql generated and when the association is one to many, the "Parameters" FK get inserted with the correct value. But in a oneToOne case, the Parameters FK always get a 0 value, which breaks the execution.
What's wrong??
Thanks
Edit:
I forgot. I'm using LinqConnect 3.0.14, Windows 7, Postgresql 9.1 (although I also tried on SQL Server)
I'm trying to create a one to one association with two tables but i keep getting FK constraint error. I've tried to change my association to one to many and the exact same model worked. So, I came here for help.
Here are my tables (they were modified to be tested easily)
Code: Select all
CREATE TABLE public."BaseEntities" (
"Id" SERIAL NOT NULL,
"Any" VARCHAR,
"Father" INT4,
CONSTRAINT "PK_BaseEntities" PRIMARY KEY ("Id"),
CONSTRAINT "FK_BaseEntities_BaseEntities_0" FOREIGN KEY ("Father") REFERENCES public."BaseEntities" ("Id")
);
CREATE TABLE public."Parameters" (
"Id" SERIAL NOT NULL,
"Value" FLOAT4 NOT NULL,
CONSTRAINT "PK_Parameters" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Parameters_BaseEntities_0" FOREIGN KEY ("Id") REFERENCES public."BaseEntities" ("Id")
);
What's wrong??
Thanks
Edit:
I forgot. I'm using LinqConnect 3.0.14, Windows 7, Postgresql 9.1 (although I also tried on SQL Server)