You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

MyBatis Exploration

We are exploring MyBatis as a faster, more flexible data access framework than Hibernate.

What is MyBatis?

MyBatis maps  Java objects to SQL result sets. This is different from Hibernate, which maps Java objects to RDBMS entities (tables or views). With MyBatis, you code SQL statements and map the result sets to Java POJOs. The quirks of the legacy MITSIS database are more readily handled by SQL than by Hibernate's object-relational model.

How Does MyBatis Work?

  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.

 

  • No labels