Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV] update jooq version 3.18.6 and vertx 4.4.5 #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<module>vertx-jooq-mutiny-jdbc</module>
</modules>
<properties>
<jooq.version>3.17.3</jooq.version>
<vertx.version>4.3.3</vertx.version>
<jooq.version>3.18.6</jooq.version>
<vertx.version>4.4.5</vertx.version>
<jackson.databind.version>2.13.2.1</jackson.databind.version>
<hsqldb.version>2.6.1</hsqldb.version>
<junit.version>4.13.2</junit.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.core.json.JsonArray;
import org.jooq.Converter;
import org.jooq.ConverterContext;
import org.jooq.JSONB;

/**
Expand All @@ -17,12 +18,12 @@ public static JSONBToJsonArrayConverter getInstance() {
}

@Override
public JsonArray from(JSONB t) {
public JsonArray from(JSONB t, ConverterContext converterContext) {
return t == null|| t.data().equals("null") ? null : new JsonArray(t.data());
}

@Override
public JSONB to(JsonArray u) {
public JSONB to(JsonArray u, ConverterContext converterContext) {
return u == null ? null : JSONB.valueOf(u.encode());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.core.json.JsonObject;
import org.jooq.Converter;
import org.jooq.ConverterContext;
import org.jooq.JSONB;

/**
Expand All @@ -17,12 +18,12 @@ public static JSONBToJsonObjectConverter getInstance() {
}

@Override
public JsonObject from(JSONB t) {
public JsonObject from(JSONB t, ConverterContext converterContext) {
return t == null || t.data().equals("null") ? null : new JsonObject(t.data());
}

@Override
public JSONB to(JsonObject u) {
public JSONB to(JsonObject u, ConverterContext converterContext) {
return u == null ? null : JSONB.valueOf(u.encode());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import io.vertx.core.json.Json;
import io.vertx.core.spi.json.JsonCodec;

import org.jooq.ContextConverter;
import org.jooq.Converter;
import org.jooq.ConverterContext;
import org.jooq.JSONB;

/**
* @author jensklingsporn
*/
public class JSONBToJsonPojoConverter<U> implements Converter<JSONB, U> {
public class JSONBToJsonPojoConverter<U> implements ContextConverter<JSONB, U> {

private final Class<U> userType;
private final JsonCodec jsonCodec;
Expand All @@ -23,12 +26,12 @@ public JSONBToJsonPojoConverter(Class<U> userType) {
}

@Override
public U from(JSONB t) {
public U from(JSONB t, ConverterContext converterContext) {
return t == null || t.data().equals("null") ? null : jsonCodec.fromString(t.data(),userType);
}

@Override
public JSONB to(U u) {
public JSONB to(U u, ConverterContext converterContext) {
return u == null ? null : JSONB.valueOf(jsonCodec.toString(u));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.core.json.JsonArray;
import org.jooq.Converter;
import org.jooq.ConverterContext;
import org.jooq.JSON;

/**
Expand All @@ -17,12 +18,12 @@ public static JSONToJsonArrayConverter getInstance() {
}

@Override
public JsonArray from(JSON t) {
public JsonArray from(JSON t, ConverterContext converterContext) {
return t == null || t.data().equals("null") ? null : new JsonArray(t.data());
}

@Override
public JSON to(JsonArray u) {
public JSON to(JsonArray u, ConverterContext converterContext) {
return u == null ? null : JSON.valueOf(u.encode());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package io.github.jklingsporn.vertx.jooq.shared.postgres;

import io.vertx.core.json.JsonObject;

import org.jooq.ContextConverter;
import org.jooq.Converter;
import org.jooq.ConverterContext;
import org.jooq.JSON;

/**
Expand All @@ -17,12 +20,12 @@ public static JSONToJsonObjectConverter getInstance() {
}

@Override
public JsonObject from(JSON t) {
public JsonObject from(JSON t, ConverterContext converterContext) {
return t == null || t.data().equals("null") ? null : new JsonObject(t.data());
}

@Override
public JSON to(JsonObject u) {
public JSON to(JsonObject u, ConverterContext converterContext) {
return u == null ? null : JSON.valueOf(u.encode());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.jklingsporn.vertx.jooq.shared.postgres;

import org.jooq.ContextConverter;
import org.jooq.Converter;

/**
Expand All @@ -11,7 +12,7 @@
* @param <T> the jooq data type, e.g. <code>org.jooq.JSONB</code>
* @param <U> the user-type
*/
public interface PgConverter<P,T,U> extends Converter<T,U> {
public interface PgConverter<P,T,U> extends ContextConverter<T,U> {

/**
* @return convert from the PGClient-type to the user-type
Expand Down