Quote:
I don't understand why you don't want to use the discriminator column for this purpose. Its the ideal way to store multiple, closely related class definitions in the same table. Plus there's no requirement to expose the discriminator-value programatically.
I don't want to modify the table. And considering what I'm trying to do, I don't think Hibernate should force me to put a dummy value in my table which forces it to always instantiate a Foo (in fact, if I insert an ExtendedFoo, I would prefer to get a regular Foo out...)
Quote:
If ExtendedFoo extends Foo then doing a find on anything Foo related will return Foo compatible instances.
But if I only map the Foo class, an insert of ExtendedFoo will throw an exception.
Quote:
The mapping files will specify where/how ExtendedFoo is stored so hibernate will take care of it.
Indeed, I could always write another mapping for the class ExtendedFoo...but that would add redundancy to my code.