TargetPerEntity Relationship

Posts   
 
    
sabina
User
Posts: 24
Joined: 16-Oct-2012
# Posted on: 24-Mar-2014 16:24:24   

Hi,

I am trying figure out how to update base type to child type entity. For example we have two tables EmpGeneral and EmpGeneralUnique1. We are able to fetch EmpGeneralUnique1 using fetchNewEntity on EmpGeneral without using prefetch path.

employeeEntity = adapter.FetchNewEntity(Of EntityClasses.EmpGeneralEntity)(filter)

However, I cannot figure out how to update existing EmpGeneralEntity to be of type EmpGeneralUnique1.(In database layer it means creating a new record in EmpGeneralUnique1 table with foreign key linked to the EmpGeneral record)

Thanks Sabina

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 24-Mar-2014 19:51:04   

In inheritance hierarchies, entities should not change types. The workaround is to delete the base entity and add the child entity. Or depend on a stored procedure for adding the child entity while maintaining the base entity intact.

sabina
User
Posts: 24
Joined: 16-Oct-2012
# Posted on: 26-Mar-2014 22:54:01   

OK Thanks!