Type of derived entity is wrong after saving (and refetching)

Posts   
 
    
TomV
User
Posts: 76
Joined: 31-Jan-2008
# Posted on: 19-Dec-2008 16:33:57   

Hi

I use inheritance of LLBLGenPro and I think I found a bug...

I have a base entity "Device"with several derived entities each with their custom properties. When I fetch a collection with all entities, they are all of the derived type, so far so good. When I change some properties via my UI (I work with DataBinding) and save my entity, I choose to refetch my entity so it would not be outOfSync.

After this refetch, the real type of my derived entity is no longer the derived type, but the type of my base entity (Device). When I then try to cast this refetched entity to the derived type, I get null reference exception because the cast didn't work.

I run with LLBLGenPro Version 2.6 (August 18th, 2008 ).

Please let me know if you need any other information.

Regards, TomV

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Dec-2008 20:06:57   
  • Some changes had been made on this subject. Please update to the lastes runtime library version.
  • Please post the relevant code you described above.
  • If possible, post a description about the configuration of your inheritance.
David Elizondo | LLBLGen Support Team
TomV
User
Posts: 76
Joined: 31-Jan-2008
# Posted on: 23-Dec-2008 08:13:17   

I just downloaded the runtime libraries of 2008-12-19. Will try this out and let you know what the result is...

Regards TomV

TomV
User
Posts: 76
Joined: 31-Jan-2008
# Posted on: 23-Dec-2008 08:25:11   

I tested and at first sight the problem is solved with this new version, or I was not able to simulate it now, because the bug not always occured. So when it would happen again, I will reactivate this thread.

Thanks for you help!

Regards TomV