Skip to content

Commit

Permalink
add retrieveGeneratedKeys option
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Jan 2, 2025
1 parent 51ef5d4 commit cd7a4d1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/main/java/minevalley/core/api/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ public static BukkitTask runAsyncTaskPeriodically(long delay, long period, @Nonn

@Nonnull
public static StatementBuilder prepareSQL(@Nonnull @Language("SQL") String sql) {
return server.prepareSQL(sql);
return server.prepareSQL(sql, false);
}

@Nonnull
public static StatementBuilder prepareSQL(@Nonnull @Language("SQL") String sql, boolean retrieveGeneratedKeys) {
return server.prepareSQL(sql, retrieveGeneratedKeys);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minevalley/core/api/CoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public interface CoreServer {
BukkitTask runAsyncTaskPeriodically(long delay, long period, @Nonnull Runnable runnable) throws IllegalArgumentException;

@Nonnull
StatementBuilder prepareSQL(@Nonnull @Language("SQL") String sql);
StatementBuilder prepareSQL(@Nonnull @Language("SQL") String sql, boolean retrieveGeneratedKeys);

void registerListener(@Nonnull Class<? extends Event> cls, @Nonnull EventListener<? extends Event> listener) throws IllegalArgumentException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.sql.*;
import java.util.concurrent.CompletableFuture;

/**
/**
* This interface covers some but not nearly all features of the {@link PreparedStatement} interface as provided by the JDBC API.
* It's designed to provide some improvements such as an asynchronous execution and a builder pattern for setting parameters to reduce boilerplate code.
* Such as the {@link PreparedStatement} interface, the results of the query can be retrieved using the {@link ResultSet} interface.
Expand Down

0 comments on commit cd7a4d1

Please sign in to comment.