Skip to content

Commit

Permalink
[#101] Add @deprecated for LegacyJooqx
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Apr 10, 2022
1 parent 2cd66d1 commit 7a3a987
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/io/github/zero88/jooqx/LegacyJooqx.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
* @see JDBCClient
* @see ResultSet
* @since 1.0.0
* @deprecated Since <a href="https://vertx.io/docs/vertx-jdbc-client/java/#_legacy_jdbc_client_api">Vertx
* deprecated</a>, this interface still works but not able to using with
* <a href="https://vertx.io/docs/vertx-rx/java3/">Rxify version 3</a> and
* <a href="https://smallrye.io/smallrye-mutiny-vertx-bindings/2.20.0/">Vertx mutiny</a>
*/
@VertxGen
@Deprecated
public interface LegacyJooqx extends LegacyInternal<SQLClient> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @since 2.0.0
*/
@VertxGen
@Deprecated
public interface LegacyJooqxBuilder extends
SQLExecutorBuilder<SQLClient, JsonArray, LegacySQLPreparedQuery, ResultSet,
LegacySQLCollector, LegacyJooqxBuilder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @since 1.0.0
*/
@VertxGen
@Deprecated
public interface LegacyJooqxTx extends LegacyInternal<SQLConnection>,
SQLTxExecutor<SQLConnection, JsonArray, LegacySQLPreparedQuery, ResultSet,
LegacySQLCollector, LegacyJooqxTx> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @since 1.0.0
*/
@VertxGen
@Deprecated
public interface LegacySQLCollector extends SQLResultCollector<ResultSet>, SQLBatchCollector<ResultSet, List<Integer>> {

static LegacySQLCollector create() {
Expand Down
16 changes: 13 additions & 3 deletions core/src/main/java/io/github/zero88/jooqx/LegacySQLImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.github.zero88.jooqx.adapter.SQLResultAdapter;
import io.github.zero88.jooqx.adapter.SelectStrategy;
import io.github.zero88.jooqx.datatype.DataTypeMapperRegistry;
import io.vertx.codegen.annotations.Nullable;
import io.vertx.core.Future;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
Expand All @@ -38,8 +39,10 @@
import io.vertx.ext.sql.SQLOperations;
import io.vertx.ext.sql.UpdateResult;

@Deprecated
final class LegacySQLImpl {

@Deprecated
interface LegacyInternal<S extends SQLOperations>
extends SQLExecutor<S, JsonArray, LegacySQLPreparedQuery, ResultSet, LegacySQLCollector> {

Expand All @@ -52,6 +55,7 @@ interface LegacyInternal<S extends SQLOperations>
}


@Deprecated
static final class LegacySQLPQ extends SQLPQ<JsonArray> implements LegacySQLPreparedQuery {

@Override
Expand All @@ -68,6 +72,7 @@ protected JsonArray doConvert(Map<String, Param<?>> params, DataTypeMapperRegist
}


@Deprecated
static final class LegacySQLRC implements LegacySQLCollector {

@NotNull
Expand Down Expand Up @@ -106,6 +111,7 @@ private Map<Field<?>, Integer> getColumnMap(ResultSet rs, Function<String, Field
}


@Deprecated
abstract static class LegacySQLEI<S extends SQLOperations>
extends SQLEI<S, JsonArray, LegacySQLPreparedQuery, ResultSet, LegacySQLCollector>
implements LegacyInternal<S> {
Expand All @@ -117,7 +123,7 @@ abstract static class LegacySQLEI<S extends SQLOperations>
}

@Override
public final <T, R> Future<R> execute(@NotNull Query query, @NotNull SQLResultAdapter<T, R> adapter) {
public final <T, R> Future<@Nullable R> execute(@NotNull Query query, @NotNull SQLResultAdapter<T, R> adapter) {
final Promise<ResultSet> promise = Promise.promise();
sqlClient().queryWithParams(preparedQuery().sql(dsl().configuration(), query),
preparedQuery().bindValues(query, typeMapperRegistry()), promise);
Expand Down Expand Up @@ -158,6 +164,7 @@ public Future<Integer> ddl(@NotNull DDLQuery statement) {
}


@Deprecated
static final class LegacyJooqxImpl extends LegacySQLEI<SQLClient> implements LegacyJooqx {

LegacyJooqxImpl(Vertx vertx, DSLContext dsl, SQLClient sqlClient, LegacySQLPreparedQuery preparedQuery,
Expand Down Expand Up @@ -190,6 +197,7 @@ protected Future<SQLConnection> openConn() {
}


@Deprecated
static final class LegacyJooqTxImpl extends LegacySQLEI<SQLConnection> implements LegacyJooqxTx {

private final LegacySQLEI<SQLClient> delegate;
Expand Down Expand Up @@ -259,8 +267,10 @@ private <X> void failed(@NotNull SQLConnection conn, @NotNull Promise<X> promise
}


static class LegacyJooqxBuilderImpl extends SQLExecutorBuilderImpl<SQLClient, JsonArray, LegacySQLPreparedQuery,
ResultSet, LegacySQLCollector, LegacyJooqxBuilder>
@Deprecated
static class LegacyJooqxBuilderImpl extends
SQLExecutorBuilderImpl<SQLClient, JsonArray, LegacySQLPreparedQuery,
ResultSet, LegacySQLCollector, LegacyJooqxBuilder>
implements LegacyJooqxBuilder {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @since 1.0.0
*/
@VertxGen
@Deprecated
public interface LegacySQLPreparedQuery extends SQLPreparedQuery<JsonArray> {

/**
Expand Down

0 comments on commit 7a3a987

Please sign in to comment.