Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.3
Hi, I mapped a legacy table with table-per-class-hierarchy strategy. All the subclasses only differs from eeach other by the discriminator, which means all the properties are the same as the super class. To match it this way is because all the required queries are all directly to subclasses, use inheritance mapping saves me a lot of restriction passing from higher layer in the application, and it did improve some performance. Now my trouble is I have to physically create the Java class for each subclass, even it only just extends the super class with empty body. Is there a way to save this Java class creation? I tried to use the same name attribute for each subclass with superclass name, and use entity-name to distinguish each subclass, but I got a WrongClassException at runtime, Hibernate complains that when populating ids for the subclasses.
Any help? Thanks a lot!