jDBI Annotation

JPA annotation extension for jDBI

Лицензия

Лицензия

Категории

Категории

JDBI Данные Базы данных
Группа

Группа

com.github.kentyeh
Идентификатор

Идентификатор

jdbi-annotation
Последняя версия

Последняя версия

0.1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

jDBI Annotation
JPA annotation extension for jDBI
Ссылка на сайт

Ссылка на сайт

http://github.com/shakiba/jdbi-annotation
Система контроля версий

Система контроля версий

http://github.com/shakiba/jdbi-annotation

Скачать jdbi-annotation

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.kentyeh/jdbi-annotation/ -->
<dependency>
    <groupId>com.github.kentyeh</groupId>
    <artifactId>jdbi-annotation</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.kentyeh/jdbi-annotation/
implementation 'com.github.kentyeh:jdbi-annotation:0.1.2'
// https://jarcasting.com/artifacts/com.github.kentyeh/jdbi-annotation/
implementation ("com.github.kentyeh:jdbi-annotation:0.1.2")
'com.github.kentyeh:jdbi-annotation:jar:0.1.2'
<dependency org="com.github.kentyeh" name="jdbi-annotation" rev="0.1.2">
  <artifact name="jdbi-annotation" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.kentyeh', module='jdbi-annotation', version='0.1.2')
)
libraryDependencies += "com.github.kentyeh" % "jdbi-annotation" % "0.1.2"
[com.github.kentyeh/jdbi-annotation "0.1.2"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
javax.persistence : persistence-api jar 1.0
org.jdbi : jdbi jar 2.77
org.slf4j : slf4j-api jar 1.7.21

test (3)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-log4j12 jar 1.7.21
com.h2database : h2 jar 1.4.192
org.testng : testng jar 6.8

Модули Проекта

Данный проект не имеет модулей.

Deprecation Notice: This project is updated and merged into jDBI 3 by Matthew Hall. This repository is not maintained any more.

JPA annotation extension for jDBI

Extension for jDBI to use JPA annotations for mapping/binding instead of JavaBeans conventions.

Usage

Annotate

Annotate your entity with JPA annotations:

import javax.persistence.Column;
import javax.persistence.Entity;

@Entity
public class Something {
    @Column
    private int id;
    @Column
    private String name;
}

Map

Use AnnoMapper to create ResultSetMapper:

ResultSetMapper<Something> mapper = AnnoMapper.get(Something.class);

Or register AnnoMapperFactory as a ResultSetMapperFactory:

@RegisterMapperFactory(AnnoMapperFactory.class)
public interface SomethingDAO {

    @SqlQuery("select * from Something where id = :id")
    Something get(@Bind("id") long id);

}

Bind

Use @BindAnno instead of @BindBean to bind annotated classes.

public interface SomethingDAO {

    @SqlUpdate("update something set name = :s.name where id = :s.id")
    void update(@BindAnno("s") Something something);

}

Maven

<dependency>
    <groupId>me.shakiba.jdbi</groupId>
    <artifactId>jdbi-annotation</artifactId>
    <version>0.1.1</version>
</dependency>

Версии библиотеки

Версия
0.1.2