One-to-one and number(10,0) are diferent between L2E and L2S

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
lancelotti
Posts: 16
Joined: Tue 23 Feb 2010 18:28

One-to-one and number(10,0) are diferent between L2E and L2S

Post by lancelotti » Tue 23 Feb 2010 18:47

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.

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

Post by AndreyR » Fri 26 Feb 2010 11:41

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.

lancelotti
Posts: 16
Joined: Tue 23 Feb 2010 18:28

Post by lancelotti » Fri 26 Feb 2010 21:02

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
);

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

Post by AndreyR » Mon 01 Mar 2010 14:16

Thank you for your inquiry. We will investigate the possibility to correct our process of LINQ model generation.

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

Post by AndreyR » Wed 03 Mar 2010 15:42

The problem is fixed. The fix will be included in the nearest build.

motuzko
Posts: 54
Joined: Tue 08 Sep 2009 18:02
Contact:

Mapping difference

Post by motuzko » Fri 05 Mar 2010 15:35

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?

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

Post by AndreyR » Tue 09 Mar 2010 15:31

This question is under discussion now.
I will let you know about the results as soon as possible.

Post Reply