Page 1 of 1

BUG: Computed columns in MySQL are not mapping properly to model data types.

Posted: Fri 20 Dec 2019 00:13
by LiamNeville
I have a column on a MySQL table that is an Int computed at the database as the sum of three other required fields. When generating the model from database that property is not placed on the autogenerated tag in the edml file. This causes an error when creating new entities and breaks on saveChanges(). I have to manually change the edml file by hand by adding this tag and then it works as expected. It seems that it is a bug that this tag is not staying. Also, upon bringing in other changes to the model this property is wiped and has to be added in manually every time.

This is the tag before (from devart autogeneration)
<Property Name="NumCycles" Type="int" />

This is the tag after I manually edit it:
<Property Name="NumCycles" Type="int" StoreGeneratedPattern="Computed" />

Re: BUG: Computed columns in MySQL are not mapping properly to model data types.

Posted: Thu 26 Dec 2019 18:29
by Shalex
In Solution Explorer, right-click *.edml > Open With > Entity Developer. Navigate to Tools > Entity Developer > Model Explorer > expand the *.Store node, select your calculated property and set Store Generated Pattern=Computed. After this, Entity Developer will add StoreGeneratedPattern="Computed" for this property in the SSDL part of your model.

We will improve Entity Developer to set StoreGeneratedPattern="Computed" for the generated columns automatically and notify you.

Re: BUG: Computed columns in MySQL are not mapping properly to model data types.

Posted: Mon 02 Mar 2020 14:35
by Shalex
The bug with detecting MySQL computed columns is fixed: viewtopic.php?f=2&t=39890.