Integrating with a relational database using a persistence (MyBatis) framework
MyBatis is a Java persistence framework. Unlike Hibernate (an ORM framework), MyBatis does not support the direct mapping of Java objects to the database but instead maps Java methods to SQL statements.
MyBatis is commonly used in migration or transformational projects where a legacy database(s) already exists. Since a lot of tables, views, and other data objects are already defined and used in the database, it may not be an ideal scenario to refactor and normalize these table/view definitions to map them directly to Java objects (using an ORM framework). MyBatis offers an ideal way of mapping Java methods to SQL statements. These SQL statements, which manage any CRUD access thereof, are defined in an XML mapper or POJO mapper using MyBatis annotations.
Furthermore, as an ORM framework (such as Hibernate) manages child entities on its own and hides the SQL part completely, some developers prefer to...