Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. You have a SQL statement that will return rows; each row will contain one or more columns. 
  2. You have Java POJOs designed to hold the data returned by the SQL query. 
  3. You have a mapping configuration that specifies how to move the SQL result set data into the Java POJOs.
  4. 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
nameDept Audit Domain Model
pageid100215784