Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
isopropylcyanide authored Apr 26, 2020
1 parent bb618a2 commit 88cf397
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@
![Travis (.org)](https://img.shields.io/travis/isopropylcyanide/dropwizard-jdbi-unitofwork)
![Codecov](https://img.shields.io/codecov/c/github/isopropylcyanide/dropwizard-jdbi-unitofwork?color=green)
![GitHub](https://img.shields.io/github/license/isopropylcyanide/dropwizard-jdbi-unitofwork?color=blue)

![Maven Central](https://img.shields.io/maven-central/v/com.github.isopropylcyanide/dropwizard-jdbi-unitofwork)

Provides `@JdbiUnitOfWork` annotation for a Jdbi backed Dropwizard backend for wrapping resource methods in a transaction context

- [`Dropwizard`](https://github.com/dropwizard/dropwizard) provides a very slick [`@UnitOfWork`](https://www.dropwizard.io/en/latest/manual/hibernate.html) annotation that wraps a transaction context around resource methods annotated with this annotation. This is very useful for wrapping multiple calls in a single database transaction all of which will succeed or roll back atomically.

- However this support is only available for `Hibernate`. For all the goodness [`Jdbi`](http://jdbi.org/jdbi2/) brings, we had to bring the transactionality on our own. This module provides support for `JdbiUnitOfWork` with a `Jdbi` backend

## Maven Artifacts

This project is available on Maven Central. To add it to your project you can add the following dependency to your
`pom.xml`:

<dependency>
<groupId>com.github.isopropylcyanide</groupId>
<artifactId>dropwizard-jdbi-unitofwork</artifactId>
<version>1.0</version>
</dependency>

## Features

Expand All @@ -22,13 +32,7 @@ Provides `@JdbiUnitOfWork` annotation for a Jdbi backed Dropwizard backend for w
## Usage

- Add the dependency to your `pom.xml`
```xml
<dependency>
<groupId>com.github.isopropylcyanide</groupId>
<artifactId>dropwizard-jdbi-unitofwork</artifactId>
<version>${dropwizard.jdbi.unitofwork.version}</version>
</dependency>
```

- Decide which implementation of `JdbiHandleManager` is suitable for your use case.

```java
Expand Down

0 comments on commit 88cf397

Please sign in to comment.