bit(1) maps to bigint (not boolean) when generating EDML

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
gr33d
Posts: 11
Joined: Tue 05 Oct 2010 21:46

bit(1) maps to bigint (not boolean) when generating EDML

Post by gr33d » Wed 12 Jan 2011 15:32

dotConnect for MySQL Professional 6.0.46.0 Beta
dbForge Fusion for MySQL 4.50.304.0

When I use the Entity Developer Create Model Wizard to create EDML, all bit(1) fields are mapped as bigint values. The Entity Framework Data Type Mapping documentation says these should be boolean which should translate to System.Boolean. There doesn't appear to be a place in the wizard to change data types, but why is this happening, and how can I change it? It doesn't make sense to change my boolean values to long in my C# code.

Should I go back to using .edmx (ADO.NET data classes)? The Devart Entity Model seems to be buggy. Is it because I'm using a beta? How can I upgrade?

Thanks in advance!

Update
The correct data types are generated when I create a LinqConnect model. I haven't used this model before, but it breaks my foreign key relationships. e.g. I can't use code like:

Code: Select all

Staff.Role.RoleName == "CustomerService"
where Role is a separate table with foreign key relationship to Staff table. Is there a way for LinqConnect to utilize these relationships?

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

Post by AndreyR » Thu 13 Jan 2011 13:31

Thank you for the report, I have reproduced the error.
I will let you know as soon as it is fixed.
As for the LinqConnect models, I have just performed a simple Dept-Emp test and the following query

Code: Select all

var q = from e in db.Emps where e.Dept.Dname == "RESEARCH" select e;
returned the correct results.
Could you please post here the code snippet causing the error?

gr33d
Posts: 11
Joined: Tue 05 Oct 2010 21:46

Post by gr33d » Thu 13 Jan 2011 16:06

I didn't even get to coding--the LinqConnect model generation doesn't visually produce the foreign key arrows I've seen with my ADO.NET entity models. The Navigation properties are also empty.

I sent a support request yesterday with a sample project and table schema reproducing the problem.

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

Post by AndreyR » Fri 14 Jan 2011 11:57

We didn't receive any mails from the address that you have provided
in your forum profile.
Could you please resend the letter if possible?
You can use the support * devart * com address or our contact form.

gr33d
Posts: 11
Joined: Tue 05 Oct 2010 21:46

Post by gr33d » Fri 14 Jan 2011 15:27

I responded to clarify the e-mail problem (I had accidentally requested support from my personal address, instead of my work address)

Anyway, it seems the Entity Model and the LinqConnect Model are both having problems creating the associations. I have tried to drag-and-drop the tables from the Database Explorer - Entity Developer with no luck.

Even when I manually try to add the association, I receive an error about 'RoleID already being in use in the Staff table'. Yes, Staff.RoleID already exists because the relationship already exists in the database.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Tue 18 Jan 2011 11:23

Please specify the server variables set on this MySQL server. You can check them, e.g., by executing the 'SHOW VARIABLES' command.

Also, could you please sheck whether any exceptions are thrown inside Entity Developer when creating a model for this database? To do so, please perform the following:
- attach to Entity Developer with Visual Studio (the Tools -> 'Attach to Process' item of the main menu);
- enable the 'Common Language Runtime Exceptions' check box in the Debug -> Exceptions dialog;
- disable the 'Enable Just My Code' check box in the Debugging section of Tools -> Options;
- create a new model (.lqml or .edml) in Entity Developer;
- if any exceptions are caught, please send us their messages and stack traces.

As for the problem with adding the association manually, could you please specify the exact error message you are getting? The problem may be caused by the RoleID property (in addition to the corresponding navigation property) being present in the Staff entity class. In this case, please try removing RoleID from Staff.

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

Post by AndreyR » Mon 24 Jan 2011 14:54

We have fixed the bit(1) problem. The fix will be available in the upcoming build.

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

Post by AndreyR » Fri 04 Feb 2011 09:54

The new build of dotConnect for MySQL 6.10.96 is available.
It can be downloaded from here (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to this announcement.

Post Reply