I could not find good documentation on how to create a mapping xml for
interfaces mixed in with inheritance. An imaginary example of type of
structure I need to map in a real world project:
interface Person() {
String getFirstName();
String getLastName();
// setters
}
class Employee() implements Person {
int getSalary();
String getFirstName();
String getLastName();
// setters
}
class Teacher extends Employee implements Person {
int getNumberOfStudents();
String getFirstName();
String getLastName();
// setters
}
How do I create a mapping XML for these? I have tried different combinations
of verify-constructable="false" for the interface and extends="Employee" for
the subclass (there isn't a similar "implements='Person'" attribute, is
there?) but this fails at least when I try to unmarshall the marshalled XML:
Caused by: java.lang.NullPointerException
at
org.exolab.castor.xml.util.XMLFieldDescriptorImpl.equals(XMLFieldDescriptorImpl.java:716)
1. Should I create "dumb" mapping for Employee, which contains firstname,
lastname, salary and numberofstudents as if interface and superclass would
not exists at all?
2. Or can I get the mapping done properly with inheritance and interface?
--
View this message in context:
http://old.nabble.com/How-to-create-mapping-for-interfaces--tp26373692p26373692.html
Sent from the Castor - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email