I have an abstract base class with existing subclasses that is used for defining both common fields and associated methods. I have a separate concrete class that "organically evolved" (i.e., bad design due to unforeseen feature requests) to end up with all the same fields defined in that abstract subclass.
Is there any way of having that separate class extend the abstract class and carry over the data from the identically named fields of existing stored instances of that separate class? I would like to use InheritanceType.SINGLE_TABLE, but if another strategy makes it easier or possible, I guess that's fine too.
Also, those are entities referenced in other entities (OneToMany). Is that a problem? Hibernate uses only one global sequence for assigning entity ids - so it should in theory be possible to not break those references even if the data is moved to another table, right?
Actually posted this to StackOverflow before, no solution yet: https://stackoverflow.com/questions/24065524/add-java-class-to-existing-inheritance-hierarchy-in-jpa-with-hibernate
|