java.lang.Object
overit.geocallapp.utilities.dataaccess.DBUtils

public class DBUtils extends Object
Utility class providing database operations and field resolution functionality.
This class offers static methods for database transaction management and field resolution operations.
Since:
1.0
  • Field Details

  • Method Details

    • commit

      public static void commit(String description, PoolKit poolKit) throws DAException
      Commits a database transaction with the specified description.
      Parameters:
      description - a descriptive text for the transaction
      poolKit - the PoolKit
      Throws:
      DAException - if a database error occurs during commit
    • rollback

      public static void rollback(String description, PoolKit poolKit) throws DAException
      Rolls back a database transaction with the specified description.
      Parameters:
      description - a descriptive text for the transaction
      poolKit - the PoolKit
      Throws:
      DAException - if a database error occurs during rollback
    • getDistinctFieldsExcludingCLOB

      public static List<String> getDistinctFieldsExcludingCLOB(DataAttributesHolder dataAttributesHolder, String table, PooledConnection pooledConnection, Company company)
      Retrieves distinct selectable fields for a single table, excluding CLOB/BLOB fields.
      Parameters:
      dataAttributesHolder - the DataAttributesHolder containing EDM configuration
      table - the name of the table to analyze
      pooledConnection - the PooledConnection for database access
      company - the Company context for the operation
      Returns:
      a list of column names that can be selected with DISTINCT
    • getDistinctFieldsExcludingCLOBWithAlias

      public static List<String> getDistinctFieldsExcludingCLOBWithAlias(DataAttributesHolder dataAttributesHolder, String table, String alias, PooledConnection pooledConnection, Company company)
      Retrieves distinct selectable fields for a single table with alias, excluding CLOB/BLOB fields.
      Parameters:
      dataAttributesHolder - the DataAttributesHolder containing EDM configuration
      table - the name of the table to analyze
      alias - the alias assigned to the table in the query
      pooledConnection - the PooledConnection for database access
      company - the Company context for the operation
      Returns:
      a list of column names that can be selected with DISTINCT
    • getDistinctFieldsExcludingCLOBFromTables

      public static List<String> getDistinctFieldsExcludingCLOBFromTables(DataAttributesHolder dataAttributesHolder, List<String> tables, PooledConnection pooledConnection, Company company)
      Retrieves distinct selectable fields for multiple tables, excluding CLOB/BLOB fields.
      Parameters:
      dataAttributesHolder - the DataAttributesHolder containing EDM configuration
      tables - the list of table names to analyze
      pooledConnection - the PooledConnection for database access
      company - the Company context for the operation
      Returns:
      a list of column names that can be selected with DISTINCT across all tables
    • getDistinctFieldsExcludingCLOBFromTablesWithAliases

      public static List<String> getDistinctFieldsExcludingCLOBFromTablesWithAliases(DataAttributesHolder dataAttributesHolder, List<String> tables, List<String> aliases, PooledConnection pooledConnection, Company company)
      Retrieves distinct selectable fields for multiple tables with corresponding aliases, excluding CLOB/BLOB fields.
      Parameters:
      dataAttributesHolder - the DataAttributesHolder containing EDM configuration
      tables - the list of table names to analyze
      aliases - the list of aliases corresponding to each table (must match table list size)
      pooledConnection - the PooledConnection for database access
      company - the Company context for the operation
      Returns:
      a list of column names that can be selected with DISTINCT across all aliased tables
    • removeControlFieldsFromDBFields

      public static List<String> removeControlFieldsFromDBFields(List<String> dbFields)
      Removes control fields from the provided list of database fields.

      This method creates a new list with system control fields filtered out. Control fields are typically used for tracking purposes but may not be needed in certain operations. The following fields are removed if present:

      • DATASTAMP - timestamp field for data modification tracking
      • LOGIN - user login field for user tracking
      • ACTION - action type field for operation tracking

      The original list is not modified. A new mutable list is created and returned. If the input list is null, an empty list is returned.

      Parameters:
      dbFields - the list of database field names to filter. Can be null or immutable.
      Returns:
      a new mutable list with control fields removed, or an empty list if input is null
      See Also: