Hi all,
We are using Hibernate 2.1.7 in our application and allow end users to extend our object model with their own subclasses. The end users may not modify our default mapping files or code, but can specify their own subclass mappings using their own modular mapping files as specified in section 5.4 of the hibernate docs. This works fine using joined subclasses when the users have created their own subclasses with additional fields, but it is not optimal to require end users to use a "joined subclass" mapping if all their subclass does is add functionality and not any new persistent fields. i.e. - in this case the separate subclass table would be redundant. Is the correct answer here to specify a discriminator column for our default class out of the box (table per class hierarchy) and use a modular mapping file that uses the "subclass" mapping? This too seems wasteful as this column will be just wasted space when the class ends up not being subclassed by the end user. What is the best practice here?
Edward
|