Sunday, March 8, 2015

FreeMarker plugin for MyBatis

Kostromin Igor has created a project to provide a FreeMarker plugin for MyBatis.

This is how a mapper looks like with FreeMarker:

@Select("select * from names where id in (${ids?join(',')})")
List<Name> findNamesByIds(@Param("ids") List<Integer> ids);

You can also use FreeMarker templates this way:

Name findName(@Param("n") String name);

Where findName.ft1 is:

FROM names
where firstName = <@p name="n"/>
See more and contribute at the project's page at Github


Saturday, October 11, 2014

MyBatis 3.2.8 Released!

Dear Community,

We have just released MyBatis 3.2.8.

Yet another bug fix release. Provides 8 minor bug fixes. See the details at

It is available as usual in Github and Maven Central.

The MyBatis Team.

Saturday, September 13, 2014

MyBatis in Practice book available

MyBatis in Practice book illustrates the use of MyBatis framework and its dependent technologies. This book provides a step-by-step approach for developing applications using MyBatis framework. It is specially designed to help the individuals who want to learn MyBatis-3 framework.

This book covers the MyBatis framework-related technology standards such as introduction to MyBatis, MyBatis support for executing select, insert, delete, and update statements, MyBatis-provided annotations, MyBatis support for executing stored procedures and functions, MyBatis integration with Spring, MyBatis integration with Velocity, MyBatis-Spring support for transaction management, and migration from iBatis to MyBatis. A step-by-step approach is followed throughout and this book contains approximately 50 Java programs for a better understanding of the topics.

The following topics are covered in this book.
  • Introduction to MyBatis 
  • Database Operations (CRUD) 
  • MyBatis Annotations 
  • MyBatis - Executing Stored Procedures and Functions 
  • MyBatis-Spring Transaction Management 
  • MyBatis with Velocity 
  • Migrating from iBatis to MyBatis

More details at:

Monday, April 7, 2014

MyBatis 3.2.7 Released

Dear commuity,

We have released MyBatis 3.2.7 as a hotfix to solve the issue #167 that breaks the @One annotation.

See the details at

It is available as usual in Github and Maven Central.

Thank you very much for your support and enjoy!

Tuesday, March 25, 2014

MyBatis-Guice 3.6 Released!

Dear Community,

We are proud to announce the release of MyBatis-Guice 3.6.

Provides some new features:
  • @Transactional annotation can be used on a class to make all methods transactional
  • Allow binding of a custom SqlSessionFactory
  • Allow binding of a custom DatabaseIdProvider
  • Some other minor improvements 

 See the details at

For users of JndiDataSourceProvider, "jndi.dataSource" property is now required. See issue #19.

It is available in Github and Maven Central.

Big thanks for your support and enjoy!