Taymyr: DDD Repository JPA

DDD Repository pattern for Lagom/Play frameworks

License

License

Categories

Categories

Java Languages
GroupId

GroupId

org.taymyr.play
ArtifactId

ArtifactId

play-repository-jpa-java
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Taymyr: DDD Repository JPA
DDD Repository pattern for Lagom/Play frameworks
Project Organization

Project Organization

Digital Economy League

Download play-repository-jpa-java

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.taymyr.play : play-repository-api-java jar 0.0.1
org.hibernate : hibernate-entitymanager jar 5.3.6.Final
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.2.71

provided (1)

Group / Artifact Type Version
com.typesafe.play : play-java-jpa_2.12 jar 2.6.0

test (4)

Group / Artifact Type Version
io.kotlintest : kotlintest-runner-junit5 jar 3.1.10
com.typesafe.play : play-test_2.12 jar 2.6.0
com.h2database : h2 jar 1.4.197
com.typesafe.play : play-jdbc-evolutions_2.12 jar 2.6.0

Project Modules

There are no modules declared in this project.

Gitter Gitter_RU Build Status Javadocs Javadocs codecov Maven

DDD Repository pattern for Lagom/Play

API of library contains only one interface Repository for DDD aggregate, inspired the book Implementing Domain-Driven Design by Vaughn Vernon.

Example

JPA

Create the interface of repository for aggregate

public interface AggregateRepository extends Repository<Aggregate, UUID> { }

and implement it

public class AggregateRepositoryImpl extends JPARepository<Aggregate, UUID> implements AggregateRepository {

    @Inject
    public AggregateRepositoryImpl(@Nonnull JPAApi jpaApi, @Nonnull DatabaseExecutionContext executionContext) {
        super(jpaApi, executionContext, Aggregate.class);
    }

    @Override
    public UUID nextIdentity() {
        return UUID.randomUUID();
    }
}

Contributors

Other persistence implementations (for MongoDB/Cassandra/Redis) are welcome.

License

Copyright © Digital Economy League (https://www.digitalleague.ru/).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

org.taymyr.play

Taymyr

Microservices business platform

Versions

Version
0.0.1