[ANNOUNCE] MyBatis Dynamic SQL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ANNOUNCE] MyBatis Dynamic SQL

Jeff Butler
Today I'm happy to announce that a new utility - MyBatis Dynamic SQL - is available.

MyBatis Dynamic SQL is an SQL generator that integrates well with MyBatis and Spring JDBC Templates.

How will you know if it's right for your project?
  • Have you ever been disappointed by the limited capabilities of the "by example" methods created by MyBatis Generator?
  • Have you tried to go "no XML" with MyBatis, but end up missing the dynamic SQL capabilities of XML?
  • Have you ever been frustrated by the SQLBuilder/SQL classes in MyBatis?
  • Have you ever hacked together an SQL string with a StringBuilder, lost track of which parameter goes with what question mark, and thought "there must be a better way"?
If you answered "yes" to any/all of these questions, then MyBatis Dynamic SQL may be an answer for you.

MyBatis Dynamic SQL implements a typesafe and expressive DSL that looks like regular SQL.  It generates an SQL string and matched set of parameters that can be used directly with MyBatis mapper methods or Spring's named parameter JDBC templates.  WHERE clauses support an arbitrarily complex conditions and all the relational operators as well as "in", "between", "like", etc.  WHERE clauses also support sub-selects.  SELECT statements support joins, unions, etc.  INSERT statements can be generated that support MyBatis batch inserts (returning generated keys for every record in the batch).

I've updated MyBatis Generator so that it can generate (MUCH smaller) code that uses this library.  I will be releasing that in the coming days.

The library has no dependencies, but does require Java 8 or better.  It is available in Maven central here:

<dependency>
  <groupId>org.mybatis.dynamic-sql</groupId>
  <artifactId>mybatis-dynamic-sql</artifactId>
  <version>1.0.0</version>
</dependency>

It is also available on the GitHub releases page here: https://github.com/mybatis/mybatis-dynamic-sql/releases
If you want to know more about why I created the library, then read this: http://www.mybatis.org/mybatis-dynamic-sql/docs/motivation.html

Please use this mailing list for questions about the project.

Jeff Butler

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.