Typically, the myBatis select method returns individual object types or generic types. For example, I want to get all the students in the class:
<select id="fetchStudentsOfClass" parameterType="int" resultMap="resultMapStudent"> SELECT * FROM students WHERE class_id=#{id} </select>
I can easily get this result: List<Student> .
Now, if I want to get such a result, not a List<Student> :
class MyClass { List<Student> getStudents{return this.students;} void setStudents(List<Student> students){this.students = students} private List<Student> students; }
How can i do this?
source share