I'm working with hibernate 3. I'll describe what I'd like to map.
I'll go with the old shape analogy.
I have a parent table shape. I have a child table circle. I'm using a join-subclass to model this part, and that seems fine. However, there are different types of circles, lets say there are red and yellow cirlces. At the end of the day, I would like to have an abstract Shape class, an abstract Cirlce class, and a RedCirlce and a YellowCircle class that will be the actual implementations.
Unless I'm mistaken, I can't add a discriminator attribute to the join-subclass, so I can't have hibernate handle the Red/Yellow stuff. Am I missing something? I can certainly just make the Circle class conrete and include a field indicating Red/Yellow, but I wanted to try it this other way.
Thanks,
Greg
|