Hurray… My first book, Java Persistence with MyBatis3, is published. I would like to thank Packt Publishers for giving me this opportunity to write about my favorite framework, MyBatis.
For most software applications, data persistence is a key and important aspect. In the Java world, we have many ways of implementing the persistence layer, starting from low-level JDBC to fancy ORM frameworks. JDBC is too low-level an API and requires writing a lot of boilerplate code. On the other hand, we have full-fledged ORM frameworks like JPA (Hibernate, EclipseLink, etc.) which hide the complexity of working with SQL directly by letting developers work with objects and generate SQL based on the RDBMS (Dialect) being used. But each approach has its own set of pros and cons; there is no one-size-fits-all solution. Many large applications are using Hibernate successfully, and many other applications got screwed up by using Hibernate/JPA incorrectly. It is not a problem with JPA/Hibernate; it is simply because JPA/Hibernate may not be the best fit for those applications, or developers don’t understand them properly.