Bugs in ADO.NET Entity Data Model Designer
Bugs in ADO.NET Entity Data Model Designer
Hi there,
I have discovered a couple of bugs in the Enity Data Model Designer.
1) When right clicking and selecting "Generate Database from Model", the DROP TABLE queries correctly use the Entity Name which is in singular form eg. "User", however the CREATE TABLE queries are generated using the Entity Set Name eg. "Users" which is obviously wrong.
2) When right clicking and selecting "Generate Database from Model", Boolean fields are generated as bit(1) fields, when they should map to tinyint(1).
And then a GREAT wish from me: PLEASE look at implementing a method for saving the diagram layout - it is messed up every time I "Update Model from Database".
Thanks in advance.
I have discovered a couple of bugs in the Enity Data Model Designer.
1) When right clicking and selecting "Generate Database from Model", the DROP TABLE queries correctly use the Entity Name which is in singular form eg. "User", however the CREATE TABLE queries are generated using the Entity Set Name eg. "Users" which is obviously wrong.
2) When right clicking and selecting "Generate Database from Model", Boolean fields are generated as bit(1) fields, when they should map to tinyint(1).
And then a GREAT wish from me: PLEASE look at implementing a method for saving the diagram layout - it is messed up every time I "Update Model from Database".
Thanks in advance.
I cannot reproduce the problem with dotConnect for MySQL v 6.50.237. The generated by EDM Wizard script includes "Users" for both DROP and CREATE statements.Miros wrote:1) When right clicking and selecting "Generate Database from Model", the DROP TABLE queries correctly use the Entity Name which is in singular form eg. "User", however the CREATE TABLE queries are generated using the Entity Set Name eg. "Users" which is obviously wrong.
1. We have reproduced the boolean problem with Entity Developer (*.edml). We will post here when it is fixed.Miros wrote:2) When right clicking and selecting "Generate Database from Model", Boolean fields are generated as bit(1) fields, when they should map to tinyint(1).
2. In case of EDM Wizard, the problem can be fixed in the following way.
Navigate to %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes, open the Devart SSDLToMySql.ttinclude file with any text editor, find the GetDbType method, and replace
Code: Select all
case "boolean":
return "bit(1)";
Code: Select all
case "boolean":
return "tinyint(1)";
We recommend you using Entity Developer (instead of EDM Designer) because we do not have a technical possibility to change behaviour of EDM Designer, but Entity Developer should save layout correctly.Miros wrote:And then a GREAT wish from me: PLEASE look at implementing a method for saving the diagram layout - it is messed up every time I "Update Model from Database".
For your info, I am using dotConnect for MySQL v. 6.50.214.0 and Entity Developer v. 4.1.41.Shalex wrote:I cannot reproduce the problem with dotConnect for MySQL v 6.50.237. The generated by EDM Wizard script includes "Users" for both DROP and CREATE statements.Miros wrote:1) When right clicking and selecting "Generate Database from Model", the DROP TABLE queries correctly use the Entity Name which is in singular form eg. "User", however the CREATE TABLE queries are generated using the Entity Set Name eg. "Users" which is obviously wrong.1. We have reproduced the boolean problem with Entity Developer (*.edml). We will post here when it is fixed.Miros wrote:2) When right clicking and selecting "Generate Database from Model", Boolean fields are generated as bit(1) fields, when they should map to tinyint(1).
2. In case of EDM Wizard, the problem can be fixed in the following way.
Navigate to %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes, open the Devart SSDLToMySql.ttinclude file with any text editor, find the GetDbType method, and replacein it withCode: Select all
case "boolean": return "bit(1)";
Save the file.Code: Select all
case "boolean": return "tinyint(1)";
We recommend you using Entity Developer (instead of EDM Designer) because we do not have a technical possibility to change behaviour of EDM Designer, but Entity Developer should save layout correctly.Miros wrote:And then a GREAT wish from me: PLEASE look at implementing a method for saving the diagram layout - it is messed up every time I "Update Model from Database".
I am using EDM Designer since my model is an ADO.NET Entity Data Model. I am working with Silverlight and Domain Services, where the latter only works with EDM (.edmx) not .edml - why is that by the way??
Many thanks for your reply!
For your info, I am using dotConnect for MySQL v. 6.50.214.0 and Entity Developer v. 4.1.41.
I am using EDM Designer since my model is an ADO.NET Entity Data Model. I am working with Silverlight and Domain Services, where the latter only works with EDM (.edmx) not .edml - why is that by the way??
For your info, I am using dotConnect for MySQL v. 6.50.214.0 and Entity Developer v. 4.1.41.
I am using EDM Designer since my model is an ADO.NET Entity Data Model. I am working with Silverlight and Domain Services, where the latter only works with EDM (.edmx) not .edml - why is that by the way??
We have answered you at http://www.devart.com/forums/viewtopic.php?t=22461.
Another bug in Entity Developer??
When building a model with Entity Developer and afterwards right-clicking and then selecting "Update Database from Model" or "Generate Database Script from Model", Boolean columns are generated created as BIT columns (see below). I have double checked that my connectionstring contains the "Tiny As Boolean=True" as it should, and I did edit the file %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\Devart SSDLToMySql.ttinclude as described in this thread.
By the way, what is the status of the bug you said you would follow up on (read in this thread: "1. We have reproduced the boolean problem with Entity Developer (*.edml). We will post here when it is fixed.")?
By the way, what is the status of the bug you said you would follow up on (read in this thread: "1. We have reproduced the boolean problem with Entity Developer (*.edml). We will post here when it is fixed.")?
Code: Select all
CREATE TABLE Module (
Id INT NOT NULL AUTO_INCREMENT,
Name LONGTEXT,
Description LONGTEXT,
Note LONGTEXT,
Type LONGTEXT,
Disabled BIT,
PRIMARY KEY (Id)
)
ENGINE = INNODB;
Miros wrote:When building a model with Entity Developer and afterwards right-clicking and then selecting "Update Database from Model" or "Generate Database Script from Model", Boolean columns are generated created as BIT columns (see below).
These two entries are about the same issue. Could you please explain us why mapping [.NET Boolean -> MySQL BIT] is not suitable for you? There is a single-valued correspondence between these two types.Miros wrote:By the way, what is the status of the bug you said you would follow up on (read in this thread: "1. We have reproduced the boolean problem with Entity Developer (*.edml). We will post here when it is fixed.")?
The "Tiny As Boolean=True" connection string parameter is taken into account only in the Database First approach.Miros wrote:I have double checked that my connectionstring contains the "Tiny As Boolean=True" as it should
"Generate Database Script from Model" is configured to not depend on connection string settings.
This setting changes behaviour of EDM Wizard (not Entity Developer).Miros wrote:I did edit the file %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\Devart SSDLToMySql.ttinclude as described in this thread.
Hi again and thanks for your reply - I understand your points.
The reason why the BIT type is not good, is discussed many places, here for example: http://www.xaprb.com/blog/2006/04/11/bi ... -in-mysql/. Read carefully the section "History".
One concrete problem I face in this context is that BIT type doesn't work with PHPMyAdmin - I don't know if it is a bug in MySQL (version 5.0.32) or PHPMyAdmin (version 2.9.1.1-Debian-9). For example it doesn't seem to be possible to insert/update data in BIT columns using the web interface.
The reason why the BIT type is not good, is discussed many places, here for example: http://www.xaprb.com/blog/2006/04/11/bi ... -in-mysql/. Read carefully the section "History".
One concrete problem I face in this context is that BIT type doesn't work with PHPMyAdmin - I don't know if it is a bug in MySQL (version 5.0.32) or PHPMyAdmin (version 2.9.1.1-Debian-9). For example it doesn't seem to be possible to insert/update data in BIT columns using the web interface.
New version of dotConnect for MySQL 6.70 is released!
It can be downloaded from http://www.devart.com/dotconnect/mysql/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=23259 .
It can be downloaded from http://www.devart.com/dotconnect/mysql/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=23259 .