Looses the assigned enum type

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
KrustyTJ
Posts: 5
Joined: Tue 03 Apr 2012 14:14

Looses the assigned enum type

Post by KrustyTJ » Tue 03 Apr 2012 14:31

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 04 Apr 2012 15:38

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.

KrustyTJ
Posts: 5
Joined: Tue 03 Apr 2012 14:14

Post by KrustyTJ » Thu 05 Apr 2012 07:02

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 06 Apr 2012 10:35

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

KrustyTJ
Posts: 5
Joined: Tue 03 Apr 2012 14:14

Post by KrustyTJ » Fri 13 Apr 2012 06:44

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.

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

Post by Helen » Fri 13 Apr 2012 13:38

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.

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

Post by Helen » Thu 26 Apr 2012 14:22

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 .

Post Reply