Compare commits

...

9 Commits

5 changed files with 246 additions and 57 deletions

104
.drone.yml Normal file
View File

@ -0,0 +1,104 @@
---
kind: pipeline
type: docker
name: snapshot-publish
trigger:
branch:
- develop
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish
image: maven:3.8.5-openjdk-17
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
commands:
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- mvn --settings maven-settings.xml -U -P snapshot clean deploy
---
kind: pipeline
type: docker
name: release-maven-central
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish maven central
image: maven:3.8.5-openjdk-17
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
GPG_PRIVATE_KEY:
from_secret: GPG_PRIVATE_KEY
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
GPG_PASSPHRASE:
from_secret: GPG_PASSPHRASE
commands:
- echo "$GPG_PRIVATE_KEY" >> gpg.key
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE --import gpg.key
- mvn --settings maven-settings.xml -U -P ossrh,release clean deploy
---
kind: pipeline
type: docker
name: release-struchkov-nexus
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish struchkov nexus
image: maven:3.8.5-openjdk-17
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
GPG_PRIVATE_KEY:
from_secret: GPG_PRIVATE_KEY
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
GPG_PASSPHRASE:
from_secret: GPG_PASSPHRASE
commands:
- echo "$GPG_PRIVATE_KEY" >> gpg.key
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE --import gpg.key
- mvn --settings maven-settings.xml -U -P ossrh,release-struchkov-nexus clean deploy
---
kind: signature
hmac: e1c7d048e5af7cc1d54a07af78193e5671d3d1f0632dc487f9be8095923af820
...

19
.gitignore vendored
View File

@ -20,23 +20,8 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/**/contentModel.xml
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
.idea/**/gradle.xml
.idea/**/libraries
.idea/
cmake-build-*/
.idea/**/mongoSettings.xml
*.iws
out/
.idea_modules/
@ -46,8 +31,6 @@ com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
.idea/httpRequests
.idea/caches/build_file_checksums.ser
*~
.fuse_hidden*
.directory

161
pom.xml
View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dev.struchkov.haiti.filter</groupId>
<artifactId>haiti-filter-quarkus-reactive</artifactId>
<version>0.5.0</version>
<version>1.0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Haiti Filter Reactive Quarkus</name>
@ -24,20 +22,27 @@
</issueManagement>
<properties>
<java.version>11</java.version>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.version>2.5.1.Final</quarkus.platform.version>
<haiti.filter.jooq.version>0.5.0</haiti.filter.jooq.version>
<quarkus.platform.version>2.16.3.Final</quarkus.platform.version>
<haiti.filter.jooq.version>1.0.0</haiti.filter.jooq.version>
<plugin.maven.compiler.ver>3.9.0</plugin.maven.compiler.ver>
<plugin.nexus.staging.ver>1.6.8</plugin.nexus.staging.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
<plugin.maven.compiler.ver>3.11.0</plugin.maven.compiler.ver>
<!-- https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin -->
<plugin.nexus.staging.ver>1.6.13</plugin.nexus.staging.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-source-plugin -->
<plugin.maven.source.ver>3.2.1</plugin.maven.source.ver>
<plugin.maven.javadoc.ver>3.3.1</plugin.maven.javadoc.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
<plugin.maven.javadoc.ver>3.5.0</plugin.maven.javadoc.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
<plugin.maven.gpg.ver>3.0.1</plugin.maven.gpg.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-release-plugin -->
<plugin.maven.release.ver>3.0.0-M7</plugin.maven.release.ver>
</properties>
<dependencyManagement>
@ -67,7 +72,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.3.1</version>
<version>42.5.0</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
@ -76,13 +81,26 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>20.1.0</version>
<version>23.0.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${plugin.maven.release.ver}</version>
<configuration>
<preparationGoals>clean install</preparationGoals>
<tagNameFormat>v.@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
<signTag>true</signTag>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
@ -94,15 +112,6 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.maven.compiler.ver}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@ -156,6 +165,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -176,6 +189,11 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -192,21 +210,106 @@
</plugins>
</build>
</profile>
<profile>
<id>release-struchkov-nexus</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<serverId>struchkov-nexus</serverId>
<nexusUrl>https://nexus.struchkov.dev/nexus/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<serverId>struchkov-nexus</serverId>
<nexusUrl>https://nexus.struchkov.dev/nexus/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>struchkov-nexus-release</id>
<url>https://nexus.struchkov.dev/repository/maven-releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>struchkov-nexus-snapshot</id>
<url>https://nexus.struchkov.dev/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>struchkov-nexus-release</id>
<url>https://nexus.struchkov.dev/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>struchkov-nexus-snapshot</id>
<url>https://nexus.struchkov.dev/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:https://github.com/haiti-projects/haiti-filter-reactive-quarkus.git</connection>
<url>https://github.com/haiti-projects/haiti-filter-reactive-quarkus</url>
<developerConnection>scm:git:https://github.com/haiti-projects/haiti-filter-reactive-quarkus.git
</developerConnection>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<tag>HEAD</tag>
</scm>
<developers>
<developer>

View File

@ -1,6 +1,6 @@
package dev.struchkov.haiti.filter.quarkus;
import dev.struchkov.haiti.utils.Assert;
import dev.struchkov.haiti.utils.Inspector;
import java.util.List;
@ -45,7 +45,7 @@ public class FilterResult<T> {
Integer elements,
List<T> content
) {
Assert.isNotNull(totalElements, elements, content);
Inspector.isNotNull(totalElements, elements, content);
return new FilterResult.Builder<>(totalElements, elements, content);
}

View File

@ -7,14 +7,13 @@ import dev.struchkov.haiti.filter.jooq.page.PageableOffset;
import dev.struchkov.haiti.filter.jooq.page.PageableSeek;
import dev.struchkov.haiti.filter.jooq.sort.SortContainer;
import dev.struchkov.haiti.filter.jooq.sort.SortType;
import dev.struchkov.haiti.utils.Assert;
import dev.struchkov.haiti.utils.Inspector;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.pgclient.PgPool;
import org.jooq.DSLContext;
import org.jooq.Query;
import org.jooq.conf.ParamType;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@ -30,7 +29,7 @@ public class QuarkusFilter<ID> {
private final PgPool pgPool;
private final CriteriaJooqFilter jooqFilter;
private PageableOffset offset;
private final List<String> sortFieldNames = new ArrayList<>();
// private final List<String> sortFieldNames = new ArrayList<>();
private QuarkusFilter(PgPool pgPool, String table, DSLContext dslContext) {
dslContext.settings().withParamType(ParamType.NAMED_OR_INLINED);
@ -64,7 +63,7 @@ public class QuarkusFilter<ID> {
}
public QuarkusFilter<ID> join(JoinTable... joinTables) {
Assert.isNotNull(joinTables);
Inspector.isNotNull(joinTables);
jooqFilter.join(joinTables);
return this;
}
@ -83,7 +82,7 @@ public class QuarkusFilter<ID> {
public QuarkusFilter<ID> sort(SortContainer container) {
if (container != null && container.getFieldName() != null) {
jooqFilter.sort(container);
sortFieldNames.add(container.getFieldName());
// sortFieldNames.add(container.getFieldName());
}
return this;
}
@ -91,7 +90,7 @@ public class QuarkusFilter<ID> {
public QuarkusFilter<ID> sort(String field, SortType sortType) {
if (field != null) {
jooqFilter.sort(field, sortType);
sortFieldNames.add(field);
// sortFieldNames.add(field);
}
return this;
}
@ -99,7 +98,7 @@ public class QuarkusFilter<ID> {
public QuarkusFilter<ID> sort(String field) {
if (field != null) {
jooqFilter.sort(field);
sortFieldNames.add(field);
// sortFieldNames.add(field);
}
return this;
}
@ -136,7 +135,7 @@ public class QuarkusFilter<ID> {
public Uni<FilterResult<ID>> filterResult(Class<ID> idType, String idField) {
jooqFilter.groupBy(tableName + "." + idField);
jooqFilter.groupBy(sortFieldNames);
// jooqFilter.groupBy(sortFieldNames);
distinctCount = true;
final Uni<Long> count = count();
final Uni<List<ID>> content = build(idType, idField);