simter-reactive-jpa

Simter reactive jpa encapsulation

Лицензия

Лицензия

MIT
Категории

Категории

React Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

tech.simter.reactive
Идентификатор

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

simter-reactive-jpa
Последняя версия

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

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

simter-reactive-jpa
Simter reactive jpa encapsulation
Ссылка на сайт

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

https://github.com/simter/simter-reactive-jpa
Организация-разработчик

Организация-разработчик

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

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

https://github.com/simter/simter-reactive-jpa.git

Скачать simter-reactive-jpa

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

<!-- https://jarcasting.com/artifacts/tech.simter.reactive/simter-reactive-jpa/ -->
<dependency>
    <groupId>tech.simter.reactive</groupId>
    <artifactId>simter-reactive-jpa</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/tech.simter.reactive/simter-reactive-jpa/
implementation 'tech.simter.reactive:simter-reactive-jpa:0.1.0'
// https://jarcasting.com/artifacts/tech.simter.reactive/simter-reactive-jpa/
implementation ("tech.simter.reactive:simter-reactive-jpa:0.1.0")
'tech.simter.reactive:simter-reactive-jpa:jar:0.1.0'
<dependency org="tech.simter.reactive" name="simter-reactive-jpa" rev="0.1.0">
  <artifact name="simter-reactive-jpa" type="jar" />
</dependency>
@Grapes(
@Grab(group='tech.simter.reactive', module='simter-reactive-jpa', version='0.1.0')
)
libraryDependencies += "tech.simter.reactive" % "simter-reactive-jpa" % "0.1.0"
[tech.simter.reactive/simter-reactive-jpa "0.1.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
javax.persistence : javax.persistence-api jar 2.2
io.projectreactor : reactor-core jar
org.springframework : spring-context jar

test (8)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter jar
org.springframework.boot : spring-boot-starter-test jar 2.1.6.RELEASE
io.projectreactor : reactor-test jar
com.ninja-squad : springmockk jar 1.1.2
org.springframework : spring-jdbc jar
org.hibernate : hibernate-entitymanager jar 5.4.3.Final
org.hibernate.validator : hibernate-validator jar 6.0.17.Final
com.h2database : h2 jar 1.4.199

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

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

simter-reactive-jpa

A reactive jpa encapsulation.

JPA is the abbreviation of Java Persistence API. Its latest specification is JSR-338. It's blocking natively and not compatible with reactive program by default. This module target to build the compatibility between JPA and reactive program. It uses a Reactor Scheduler that diff to reactor main thread to avoid JPA block the reactor main thread. And this scheduler could be customized or just use the default behavior Schedulers.elastic().

Usage

Maven:

<dependency>
  <groupId>tech.simter.reactive</groupId>
  <artifactId>simter-reactive-jpa</artifactId>
  <version>{version}</version>
</dependency>
<dependency>
  <groupId>tech.simter.reactive</groupId>
  <artifactId>simter-reactive-test</artifactId>
  <version>{version}</version>
</dependency>

Java:

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import reactor.test.test;
import tech.simter.reactive.jpa.ReactiveEntityManager;
import tech.simter.reactive.test.jpa.ReactiveDataJpaTest;

@SpringJUnitConfig(tech.simter.reactive.jpa.ModuleConfiguration.class)
@ReactiveDataJpaTest
public class TheTest {
  @Autowired
  private ReactiveEntityManager rem;

  @Test
  public test() {
    // save
    MyPo po = new MyPo();
    StepVerifier.create(rem.persist(po))
      .expectNext(po).verifyComplete();

    // find one
    StepVerifier.create(
      rem.createQuery("select t from MyPo t where id = :id", MyPo.class)
      .setParameter("id", 123)
      .getSingleResult()
    ).expectNext(po).verifyComplete();

    // find list
    StepVerifier.create(
      rem.createQuery("select t from MyPo t", MyPo.class)
      .getResultList()
    ).expectNext(po).verifyComplete();
  }
}

@ReactiveDataJpaTest comes from simter-reactive-test.

tech.simter.reactive

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

Версия
0.1.0