Hi,
I'm sorry I misread your fist post.
I don't know if it's actually possible to do what you want, but here is one thing you can do :
class Main {
private long id;
private String field;
private String otherFieldToBeMerged;
// getters/setters
setMyAssociation(MyAssotiation a) {
// maybe check id
this.otherFieldToBeMerged = a.getFieldToMerge();
}
}
class MyAssocation {
private long id;
private String fieldToMerge;
// getters/setters
}
You can make the MyAssociation class and the setMyAssociation method package private so that it's only visible within the Mapper scope.
I might have missed it but I don't know anything in MyBatis that can merge the results of two selects.
Dridi
http://www.zenika.com/