Hi
I've got two tables, one of which is an extension of the other using the joined-subclass mapping.
So I have PpiProduct extends Product
Saving and deleting them is fine, but I was wondering what the best (only?) was of converting one into the other (say the user edits a Product, and sets a flag that means its now a PpiProduct)
I'm getting a bit stuck trying to convert from one to the other. If I try to create the new PpiProduct (to fill in the extra fields in the extension table), I get a Duplicate PK-type exception (because it also tries to create a new entry in the Product table too)
If I try to update it, I get other errors (warnings about the object being transient/unsaved etc).
When I want to change one into the other, am I best deleting the original record, and inserting a completely new one?
Thanks
Richard
|