I wish to map an interface hierarchy which is implemented by a set of classes which do not have similar hierarchy. Example:
Mapped classes:
Code:
public interface IParent {
int getP();
void setP(int p);
}
public interface IChild extends IParent {
int getC();
void setC(int c);
}
public class ParentImpl extends Object {
int p;
public int getP() {
return this.a;
}
public void setP(int p) {
this.p = p;
}
}
public class ChildImpl implements IChild extends SomeOtherObject {
int p;
int c;
public int getP() {
return this.a;
}
public void setP(int p) {
this.p = p;
}
public int getC() {
return this.c;
}
public void setC(int c) {
this.c = c;
}
}
The key point being that ChildImpl does not extend ParentImpl (as I need it to extend something else).
Is it possible to map these classes such that polymorphism loads / queries will still work?