Page 1 of 1

Linqconnect - One to One Mapping Issues

Posted: Mon 27 Sep 2010 03:05
by meetkarthik
Consider the following two tables , Student and Student_GPA.

Code: Select all

CREATE TABLE "STUDENT" 
   (	"ID" NUMBER NOT NULL ENABLE, 
	"NAME" VARCHAR2(20), 
	 CONSTRAINT "STUDENT_PK" PRIMARY KEY ("ID") ENABLE
   ) TABLESPACE "DATA" ;

CREATE TABLE "STUDENT_GPA" 
	(	"STUDENT_ID" NUMBER NOT NULL ENABLE, 
	"GPA" NUMBER NOT NULL ENABLE, 
	 CONSTRAINT "STUDENT_GPA_PK" PRIMARY KEY ("STUDENT_ID") ENABLE
	) TABLESPACE "DATA" ;

ALTER TABLE "STUDENT_GPA" ADD CONSTRAINT "STUDENT_GPA_STUDENT_FK1" FOREIGN KEY ("STUDENT_ID")
	  REFERENCES "STUDENT" ("ID") ENABLE;

The table Student has a primary key 'ID'. In the table Student_GPA , the Student_Id column is the primary key and it also references the ID in the student table.

When i try to generate the model ,
1. It sets the relationship between Student and Student_Gpa as 'one to many'. Shouldn't it be one to one ?

2. I tried to manually set this as 'one to one' and when i checked out the relationship , it was correctly displaying 'STUDENT' as the parent table and 'STUDENT_GPA' as the child table. But when i try to do my inserts , its trying to insert into the student_gpa first and this results in an exception as the 'STUDENT' record has not been inserted yet. Shouldn't it insert into the parent table first and then fire the inserts for the child tables ?

Please let me know if i am doing anything wrong or if these are known bugs ?

Posted: Tue 28 Sep 2010 12:13
by StanislavK
Thank you for your report, we've reproduced both issues. We will investigate them and inform you about the results.

Posted: Thu 14 Oct 2010 15:46
by StanislavK
We have fixed the problem. The fix is available in the new 5.70.180 build of dotConnect for Oracle. You can download it from
http://www.devart.com/dotconnect/oracle/download.html
(the trial version only) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/

For more information about the improvements and fixes available in dotConnect for Oracle 5.70.180, please refer to
http://www.devart.com/forums/viewtopic.php?t=19236