Hi guys, having some trouble figuring out the best way to handle a situation. I've got a parent Form object which contains a bunch of Field children. Field is an abstract class, there are a number of concrete subclasses, e.g. NumberFormat, DateField, TextField, etc. I'm using the discriminator column style of subclass mapping, and it works quite nicely.
I now need to be able to change the classes of some of the fields without changing their identifiers (there are other objects in the hierarchy which reference them). I need, for example, to turn a TextField into a NumberField. Is it possible to do this in hibernate without resorting to hand-crafted sql? Would it be better to collapse my Field class hierarchy, at least as far as hibernate is concerned?
|