Skip to content

Commit 36a37f1

Browse files
committed
feat: implementation of base classes for the CQRS pattern
1 parent 4f3f36d commit 36a37f1

File tree

6 files changed

+88
-34
lines changed

6 files changed

+88
-34
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2010 Bennu SpA Authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+31-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
1-
# Uso de librería bennu-commons
1+
Bennu MyBatis-Commons
2+
===================
23

3-
Para usar esta librería en los proyectos de Maven debes incluir el siguiente bloque:
4+
[![Maven Central](https://img.shields.io/maven-central/v/cl.bennu/mybatis-commons?label=Maven%20Central&logo=sonatype)](https://search.maven.org/artifact/cl.bennu/mybatis-commons)
5+
[![License](https://img.shields.io/github/license/bennu/mybatis-commons?label=License&logo=opensourceinitiative)](https://opensource.org/license/mit-0)
6+
[![Supported JVM Versions](https://img.shields.io/badge/JVM-17--21-brightgreen.svg?label=JVM&logo=openjdk)](https://adoptium.net/es/temurin/releases/)
47

5-
```
8+
Bennu MyBatis-Commons, a package of Java utility classes for
9+
classes that are repeated in our mybatis projects.
10+
11+
The code is tested using the latest revision of the JDK for supported
12+
LTS releases: 17 and 21.
13+
14+
```xml
615
<dependency>
716
<groupId>cl.bennu</groupId>
817
<artifactId>mybatis-commons</artifactId>
9-
<version>0.0.1</version>
18+
<version>1.0.0</version>
1019
</dependency>
1120
```
1221

13-
### Esta librería cuenta con las siguientes dependencias:
14-
15-
- lombok 1.18.36
16-
- jackson-core 2.18.2
17-
- jackson-annotations 2.18.2
18-
- commons-lang3 3.17.0
19-
- commons-io 2.18.0
20-
- java-jwt 4.4.0
21-
- commons-beanutils 1.10.0
22-
- commons-collections4 4.5.0-M3
23-
- slf4j-api 2.0.16
22+
Building
23+
--------
24+
25+
Building requires a Java JDK and [Apache Maven](https://maven.apache.org/).
26+
The required Java version is found in the `pom.xml` as the `maven.compiler.source` property.
27+
28+
From a command shell, run `mvn` without arguments to invoke the default Maven goal to run all tests and checks.
29+
30+
License
31+
-------
32+
33+
This code is licensed under the [MIT License](https://opensource.org/license/mit).
34+
35+
Dependencies
36+
------------
37+
38+
- commons 1.1.0
39+
- mybatis 3.5.19

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>cl.bennu</groupId>
99
<artifactId>mybatis-commons</artifactId>
10-
<version>0.0.2</version>
10+
<version>1.0.0</version>
1111
<name>bennu-mybatis-commons</name>
1212
<description>Utilitarios bennu para MyBatis</description>
1313
<url>https://github.com/bennu/mybatis-commons</url>
@@ -48,7 +48,7 @@
4848
<dependency>
4949
<groupId>cl.bennu</groupId>
5050
<artifactId>commons</artifactId>
51-
<version>0.1.0</version>
51+
<version>1.1.0</version>
5252
</dependency>
5353
<dependency>
5454
<groupId>org.mybatis</groupId>
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
package cl.bennu.commons.mapper.base;
22

33
import cl.bennu.commons.domain.base.BaseDomain;
4+
import cl.bennu.commons.mapper.base.cqrs.CommanderMapper;
5+
import cl.bennu.commons.mapper.base.cqrs.QueryMapper;
46

5-
import java.util.List;
6-
7-
public interface BaseMapper<T extends BaseDomain> {
8-
9-
List<T> getAll();
10-
11-
List<T> find(T type);
12-
13-
T get(Long id);
14-
15-
T getByName(String name);
16-
17-
void insert(T type);
18-
19-
void update(T type);
20-
21-
void delete(Long id);
7+
public interface BaseMapper<T extends BaseDomain>
8+
extends CommanderMapper<T>, QueryMapper<T> {
229

2310
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package cl.bennu.commons.mapper.base.cqrs;
2+
3+
import cl.bennu.commons.domain.base.BaseDomain;
4+
5+
public interface CommanderMapper<T extends BaseDomain> {
6+
7+
void insert(T type);
8+
9+
void update(T type);
10+
11+
void delete(Long id);
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cl.bennu.commons.mapper.base.cqrs;
2+
3+
import cl.bennu.commons.domain.base.BaseDomain;
4+
5+
import java.util.List;
6+
7+
public interface QueryMapper<T extends BaseDomain> {
8+
9+
List<T> getAll();
10+
11+
List<T> find(T type);
12+
13+
T get(Long id);
14+
15+
T getByName(String name);
16+
17+
}

0 commit comments

Comments
 (0)