The discriminator may do this kind of thing.
You could look at that article :
http://www.onjava.com/lpt/a/6092
or the section 6.1.6 and 10.1.3 of the documentation:
6.1.6. discriminator
The <discriminator> element is required for polymorphic persistence using the table-per-class-hierarchy mapping strategy and declares a discriminator column of the table. The discriminator column contains marker values that tell the persistence layer what subclass to instantiate for a particular row. A restricted set of types may be used: string, character, integer, byte, short, boolean, yes_no, true_false.
Etienne