Class StorageUtils

java.lang.Object
me.confuser.banmanager.common.util.StorageUtils

public class StorageUtils extends Object
  • Constructor Details

    • StorageUtils

      public StorageUtils()
  • Method Details

    • updateTimestampsToDbTime

      public static void updateTimestampsToDbTime(me.confuser.banmanager.common.ormlite.dao.BaseDaoImpl<?,?> dao, DatabaseConfig dbConfig, String tableName, int id, boolean hasUpdated) throws SQLException
      Updates the created and updated timestamps to database time using the DAO. This ensures timestamps are always from the database, not the JVM, for cross-server sync. Uses the DAO's executeRaw to avoid connection pool issues.
      Parameters:
      dao - the DAO to use for executing the update
      dbConfig - the database config (provides timestamp expression)
      tableName - the table name
      id - the generated ID of the inserted row
      hasUpdated - whether the table has an 'updated' column
      Throws:
      SQLException - if the update fails
    • updateTimestampsToDbTime

      public static void updateTimestampsToDbTime(me.confuser.banmanager.common.ormlite.support.ConnectionSource connectionSource, DatabaseConfig dbConfig, String tableName, int id, boolean hasUpdated) throws SQLException
      Throws:
      SQLException
    • convertIpColumn

      public static void convertIpColumn(BanManagerPlugin plugin, String table, String column)
    • convertIpColumn

      public static void convertIpColumn(BanManagerPlugin plugin, String table, String column, String idType)