There are many abstraction layer libraries over JDBC that add much needed syntax sugar and resource handling safety. Even so, sometimes I find it difficult to find a suitable one for the applications I work on. Either because they constrain in some way or have other unwanted properties (like transitive dependencies).
In some cases I implemented abstractions of my own and a library has started to emerge. I decided to collect those ideas and make it a library for easier reuse. A library that makes the most common SQL querying operations as simple, declarative as possible, is light-weight, has no dependencies. Most similar libraries don't make use of a fluent API which makes way for some interesting possibilities in terms of both readability and flexibility. Also I wanted to support operations that work with large amount of data (streaming, batching).
Some of FluentJdbc 's features:
- execution of select/insert/update/delete/alter/... statements as one-liners
- parameter mapping (named, positional, supporting java.time, Optional, plugins for any types)
- access to generated keys
- result -> pojo mapping
- transaction handling
- big data (streaming select / batch insert)
<dependency> <groupid>org.codejargon</groupid> <artifactid>fluentjdbc</artifactid> <version>1.3</version> </dependency>Note: java 8 only
No comments:
Post a Comment