...
- You have a SQL statement that will return rows; each row will contain one or more columns.
- You have Java POJOs designed to hold the data returned by the SQL query.
- You have a mapping configuration that specifies how to move the SQL result set data into the Java POJOs.
- You have a mapper Java interface that provides the ability to actually run the query and populate the POJOs.
The Pieces
A sample project is available at <svn+ssh://svn.mit.edu/es-common-services-framework/sturner/mybatis-deptaudit-test>
This project uses MyBatis to retrieve the data involved in the Departmental Audit API. This involves getting a list of students who are in a particular department for a given term. For each student, various sets of data are retrieved. For this overview, we'll concentrate on the students and their courses. The simplified object model is:
Gliffy Diagram | ||||
---|---|---|---|---|
|