-1

Actually I am new in My batis and wanted to help me out in bellow scenario

I wanted to return Object Which has two list as a member, from Result of select Query in Mybatis. for example my object Class

    public class ABC{
    List Boys;
    List Girls;
}

And I wanted to generate single instance of ABC from bellow Query

Select Boy_roll_no , Boy_name, Girl_roll_no , Girl_name from Classdata 

Can anybody help me out how to do xml configuration(How to define resultmap for query ) for Mybatis

SandeepT
  • 81
  • 1
  • 4

1 Answers1

0

I don't think you can return such a complex object from MyBatis. Generally MyBatis will return "list of objects" that can be beans but, as far as I know, there is no way to return "object of lists". What you have to do is make two separate queries that return the boy's list and the girl's list and in your business logic put both in your ABC object. Hope this helps you.

Thrash Bean
  • 658
  • 4
  • 7