I have a Student
object extending Person
object.
public abstract class Person implements IIdentifiable {
private String contactNumber;
// other properties
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
}
public class Student extends Person {
private String studentNumber;
//Other properties
public String getStudentNumber() {
return studentNumber;
}
public void setStudentNumber(String studentNumber) {
this.studentNumber = studentNumber;
}
}
Student has a property studentNumber
and person has a property contactNumber
. When I map Student object to StudentDto
it get confused on given properties.
public class StudentDto{
private String studentNumber;
public String getStudentNumber() {
return studentNumber;
}
public void setStudentNumber(String studentNumber) {
this.studentNumber = studentNumber;
}
}
This happens on certain occations only. I'm wondering what would be the reason
1) The destination property com.cinglevue.veip.web.dto.timetable.StudentDto.setStudentNumber() matches multiple source property hierarchies:
com.cinglevue.veip.domain.core.student.StudentProfile.getStudent()/com.cinglevue.veip.domain.core.Person.getContactNumber()
com.cinglevue.veip.domain.core.student.StudentProfile.getStudent()/com.cinglevue.veip.domain.core.Student.getStudentNumber()