Hello I've got some generated code which I'd like to use with MyBatis but some of the properties on the concrete classes are of Interface type.
Example
class Example {
private List<IPerson> people;
public void setPeople ( List<IPerson> value ) {
}
public List<IPerson> getPeople( ) {
}
}
class PersonImpl implements IPerson {
}
When I try to set the results from the mapping to the property people I get this exception
Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'XX' of 'class xx' with value '[XX]' Cause: java.lang.IllegalArgumentException: argument type mismatch
Any suggestions on how i can set this property using PersonImpl class ?
Comment From: harawata
It is not possible to instantiate an interface, so you need to specify javaType
or ofType
in the result map.
Please post your question to the mailing list or Stack Overflow. Thank you!