commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mansour Al Akeel <mansour.alak...@gmail.com>
Subject [dbutils] Adding fluent api
Date Tue, 30 Jun 2015 21:57:45 GMT
I am not sure if this is the right place to suggest this. Please let
me know, before filling a Jira Ticket.
I believe DbUtils has place for additional component:

- A fluent API to generate SQL string:

Developers find it difficult to concatenate strings to build a query.
A fluent API makes it relatively easier, and keeps the query vendor
independent.
Some of the examples:
* http://iciql.com/
* http://jodd.org/doc/db/sqlgenerator.html
* http://jdbi.org/
* Jooq
* https://mybatis.github.io/mybatis-3/statement-builders.html

I am not talking about the mapping part. I am only suggesting
generating the SQL string builder functionality. Something similar to
MyBatis:

  String sql = new SQL()
    .INSERT_INTO("PERSON")
    .VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
    .VALUES("LAST_NAME", "${lastName}")
    .toString();

I am wondering how much effort this can be, and most important if
thers's interest in the community to create a separate independent
component just for Sql String generation. MyBatis is under ASL 2.0
license.

Anyone else think there's a place in DBUtils for this functionaity ?

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message