Class MySQLDialect


public class MySQLDialect extends SQLDialect
SQL dialect for MySQL database
  • Constructor Details

  • Method Details

    • getTablesImpl

      @NotNull public @NotNull PreparedStatement getTablesImpl() throws SQLException
      Description copied from class: SQLDialect
      Get all tables from the database
      Specified by:
      getTablesImpl in class SQLDialect
      Returns:
      the PreparedStatement with the set parameters
      Throws:
      SQLException - if a database error occurs
    • createTableImpl

      @NotNull public @NotNull PreparedStatement createTableImpl(@NotNull @NotNull String table) throws SQLException
      Description copied from class: SQLDialect
      Create a table in the database
      Specified by:
      createTableImpl in class SQLDialect
      Parameters:
      table - the table to create
      Returns:
      the PreparedStatement with the set parameters
      Throws:
      SQLException - if a database error occurs
    • createKeyImpl

      @Nullable public @Nullable PreparedStatement createKeyImpl(@NotNull @NotNull String table, @NotNull @NotNull String key) throws SQLException
      Description copied from class: SQLDialect
      Create a key in the given table
      Specified by:
      createKeyImpl in class SQLDialect
      Parameters:
      table - the table to create the key in
      key - the key to create
      Returns:
      the PreparedStatement with the set parameters
      Throws:
      SQLException - if a database error occurs
    • getAllValuesFromDatabaseImpl

      @NotNull protected @NotNull PreparedStatement getAllValuesFromDatabaseImpl(@NotNull @NotNull String table) throws SQLException
      Description copied from class: SQLDialect
      Get all values from the database
      Specified by:
      getAllValuesFromDatabaseImpl in class SQLDialect
      Parameters:
      table - the table to get the values from
      Returns:
      the PreparedStatement with the set parameters
      Throws:
      SQLException - if a database error occurs
    • getFromDatabaseImpl

      @NotNull public @NotNull Optional<String> getFromDatabaseImpl(@NotNull @NotNull String table, @NotNull @NotNull String target, @NotNull @NotNull String column)
      Description copied from class: Dialect
      Get a value from the database
      Specified by:
      getFromDatabaseImpl in class Dialect
      Parameters:
      table - the table to get from
      target - the target to get from
      column - the key to get
      Returns:
      the value, empty if not found
    • setToDatabaseImpl

      @Nullable public @Nullable FailedSet setToDatabaseImpl(@NotNull @NotNull String table, @NotNull @NotNull String target, @NotNull @NotNull String column, @NotNull @NotNull String value)
      Description copied from class: Dialect
      Set a value to the database
      Specified by:
      setToDatabaseImpl in class Dialect
      Parameters:
      table - the table to set to
      target - the target to set to
      column - the key to set
      value - the value to set
      Returns:
      the failed value information, null if successful
    • setToDatabaseImpl

      @NotNull public @NotNull Set<FailedSet> setToDatabaseImpl(@NotNull @NotNull String table, @NotNull @NotNull String target, @NotNull @NotNull ConcurrentHashMap<String,Value> data)
      Description copied from class: Dialect
      Set multiple values to the database
      Specified by:
      setToDatabaseImpl in class Dialect
      Parameters:
      table - the table to set to
      target - the target to set to
      data - the data to set
      Returns:
      set of failed values as FailedSets
    • removeFromDatabaseImpl

      public boolean removeFromDatabaseImpl(@NotNull @NotNull String table, @NotNull @NotNull String target, @NotNull @NotNull String column)
      Description copied from class: Dialect
      Remove a value from the database
      Specified by:
      removeFromDatabaseImpl in class Dialect
      Parameters:
      table - the table to remove from
      target - the target to remove from
      column - the key to remove
      Returns:
      true if the value was successfully removed, false otherwise