Page 1 of 1

Looses the assigned enum type

Posted: Tue 03 Apr 2012 14:31
by KrustyTJ
Hello,
I'm using the latest Entity Developer. When updating the model from database or only renaming some properties, the entity looses the assigned enum type and changes back to the original Int16 or Int32 type. It's really annoying, because i have to change all enum types back everytime when i change the model. It seems to be a bug. Could you please fix it in next release?

Tomas Juricek

Posted: Wed 04 Apr 2012 15:38
by Shalex
We cannot reproduce the issue using the latest (4.3.159) version of Entity Developer. Which ORM (NHibernate/LinqConnect/LINQ to SQL) are you working with? Please send us a small test model and specify the exact steps we should follow to reproduce the problem in our environment.

Posted: Thu 05 Apr 2012 07:02
by KrustyTJ
I'm working with NHibernate, using database first approach. I have tried to find the exact steps, but it's hard to reproduce.

1. Open correct hbml model (correct enum types) in entity devoloper editor in VS
2. Do some changes (rename properties, add tables, relationship).
3. Save and close model
4. Open model again and check enum types
5. If enum types are correct, go back to step 1
6. From now, entity developer editor are always showing database types instead of enum types even if i do revert and have correct hbml model. Only visual studio restart helps.

Posted: Fri 06 Apr 2012 10:35
by Shalex
We cannot reproduce the problem. The only way to make Entity Developer remove enum and assign back database type is to run Update Model From Database if column (of enum property) in the database was changed.

If you find exact steps, please specify them (and send us a test model if necessary).

Posted: Fri 13 Apr 2012 06:44
by KrustyTJ
Still can't find exact steps. I'm working with Entity Developer for 3 hours, only changing the property names. After 3 hours of working i get the same error.

I tried to find out what changed. I have model ClientModel, entity Account, column AccountType and enum AccountType.

ClientsModel.Account.hbm.xml xml fragment:
<property name="AccountType" type="Int16">
<column name="srazet" default="0" not-null="true" precision="5" scale="0" sql-type="smallint" />
</property>

ClientsModel.hbml xml fragment:
<property name="AccountType" type="Anete.Office.Clients.DataSources.Entities.AccountType" p1:ValidateRequired="True" p1:Guid="631e64ce-3a31-4d22-aacf-0cca531065b1">
<column name="srazet" default="0" not-null="true" precision="5" scale="0" sql-type="smallint" />
</property>

ClientsModel.hbml still have connection to AccountType, ClientsModel.Account.hbm.xml is back to Int16.

I have checked properties in Entity Developer and Visual Studio designer. Entity Developer shows correct AccountType, Visual Studio designer shows Int16 type.

Posted: Fri 13 Apr 2012 13:38
by Helen
Thank you for the detailed explanation. We have reproduced the described behaviour.
We will investigate the issue and notify you about the results as soon as possible.

Posted: Thu 26 Apr 2012 14:22
by Helen
The latest 4.3.178 build of Entity Developer contains a fix for the issue with incorrect saving the class property type when this type is set to enum.
It can be downloaded from http://www.devart.com/entitydeveloper/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=24003 .