I would like to use hibernate to contain a hierarchy of objects, however the discriminator column is a foreign key to another table that contains the CODE defining the subclass type.
Is it possible to specify the code from the joined table as the discriminator, or do I have to use the key values and hope the keys stay consistent?
e.g. discriminator="square|circle" v.s. discriminator="0|1"
table: shape
area=25 shape_type_fk=0
area=10 shape_type_fk=1
table: shape_types
ID CODE
0 square
1 circle