Hey,
Obviously Java doesn't support multiple inheritance. However, using interfaces its possible to get into a situation in Hibernate that is somewhat similar, that is the data model seems to require multiple inheritance. Take for example:
Code:
interface Consumable
abstract class Liquid
class Pizza implements Consumable
class Wine extends Liquid implements Consumable
class Mercury extends Liquid
I need to be able to use Hibernate to query over Consumables and Liquids.
Other classes need to have many-to-one relationships with a Consumable and/or Liquid.
So my questions are whether this setup is supported well by Hibernate and if so, how the table structure would be set up. I figure the database will not be able to have FKs to both Consumable and Liquid since this would come up against the multiple inheritance problem. But I'm not sure of that. I guess there are some complicated table schemas that would enforce unique ids over both types. However, Hibernate seems to require that a <subclass> only exist in one <class>.
Any thoughts, suggestions?