Sound OO design principles dictate the use of interface/implementation pairs for java objects.
If, for example, I have IParent and IChild interfaces, and Parent/Child implementations respectively, how do I map these?
I don't seem to be able to map the IParent/IChild interfaces, and work directly with Parent/Child objects. I can map the concrete Parent/Child objects fine, but then the getter/setters cause problems if they deal with Interfaces. For example:
Code:
class Child {
...
public IParent getParent() {...}
...
}
causes a
Code:
net.sf.hibernate.MappingException: property-ref to unmapped class: IParent
exception during initialization.
I have searched the User Document, FAQs and forums with no luck. Is there a way of doing this that I am overlooking?
Any help would be appreciated.
-Mitch
P.S. I am using JDK 1.4.2 with Hibernate 2.1.