We have a table which contains several classes, all inheriting from a single base-class. So we have baseclass A and subclasses Ab and Ac. Updating items of the different sub-classes is no problem in the code, we just pick up the items as an A, and then check if they are Ab or Ac and update the different properties of the specific classes.
But now the need has arisen to change one item from an Ab type to an Ac type. The Id of the item may not change as this will screw up relationships to other items. So taking an Ab-item, copying properties to a new Ac-item, remove the Ab and add the Ac is not possible as this will give the item a new Id. Casting the item from Ab to Ac is of course not possible.
How can I go about doing this while still keeping the Id? The id is an auto-increment int.