Page 1 of 1
One-to-one and number(10,0) are diferent between L2E and L2S
Posted: Tue 23 Feb 2010 18:47
by lancelotti
If I drag-n-drop 2 tables with one-to-one relationship with linq to entities it works great, but with link to sql don't. It generate a one-to-many.
I use Oracle and many things doesn´t work with Linq to SQL that works with Linq to Entities.
Ex.:
NUMBER(10,0) are mapped as decimal instead int
NUMBER(1,0) are mapped as int instead bool
Functions that return NUMBER(10,0) OR NUMBER(9,0) are mapped as double instead int
There is a configuration to this? Why entity developer generate different types to de same tables?
Thaks.
Posted: Fri 26 Feb 2010 11:41
by AndreyR
I have just checked using the latest 5.55.97 build of dotConnect for Oracle.
Both Entity Framework and LINQ to SQL models are generated as one-to-many and then
after changing the association cardinality the code is generated correctly.
Could you please provide me with the script you are experiencing the problem with?
Thank you for the suggestion regarding number mappings. I will let you know about the results of our discussion.
Posted: Fri 26 Feb 2010 21:02
by lancelotti
Yes, Entity Framework generete a 1 to 0...1 while Linq to SQL generate a 1 to *
Code: Select all
CREATE TABLE "PESSOA"
(
"ID" NUMBER(9,0) NOT NULL ENABLE,
CONSTRAINT "PESSOA_PK" PRIMARY KEY ("ID") ENABLE
);
CREATE TABLE "ALUNO"
(
"PESSOA" NUMBER(9,0) NOT NULL ENABLE,
CONSTRAINT "ALUNO_PK" PRIMARY KEY ("PESSOA") ENABLE,
CONSTRAINT "ALUNO_PESSOA_FK1" FOREIGN KEY ("PESSOA") REFERENCES "PESSOA" ("ID") ENABLE
);
Posted: Mon 01 Mar 2010 14:16
by AndreyR
Thank you for your inquiry. We will investigate the possibility to correct our process of LINQ model generation.
Posted: Wed 03 Mar 2010 15:42
by AndreyR
The problem is fixed. The fix will be included in the nearest build.
Mapping difference
Posted: Fri 05 Mar 2010 15:35
by motuzko
What about this part:
NUMBER(10,0) are mapped as decimal instead int
NUMBER(1,0) are mapped as int instead bool
Functions that return NUMBER(10,0) OR NUMBER(9,0) are mapped as double instead int
Is it going to be fixed?
The problem is that in LINQ to SQL there is no way to map ANY oracle type to Boolean. Also, the mappings from
http://www.devart.com/forums/viewtopic.php?t=15604 are not consistent with LINQ to SQL mappings. Would you please unify that?
Posted: Tue 09 Mar 2010 15:31
by AndreyR
This question is under discussion now.
I will let you know about the results as soon as possible.