Skip to content

Commit

Permalink
add generateUniqueId()
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Jan 5, 2025
1 parent 8d92d2d commit f815f06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/minevalley/core/api/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public static StatementBuilder prepareSQL(@Nonnull @Language("SQL") String sql,
return server.prepareSQL(sql, retrieveGeneratedKeys);
}

public static int generateUniqueId(@Nonnull String table, @Nonnull String column, int amountOfChars) throws IllegalArgumentException {
return server.generateUniqueId(table, column, amountOfChars);
}

/**
* Registers an event listener.
*
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/minevalley/core/api/CoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public interface CoreServer {
@Nonnull
StatementBuilder prepareSQL(@Nonnull @Language("SQL") String sql, boolean retrieveGeneratedKeys) throws SQLException;

int generateUniqueId(@Nonnull String table, @Nonnull String column, int amountOfChars) throws IllegalArgumentException;

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

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

0 comments on commit f815f06

Please sign in to comment.