Class DBUtils
java.lang.Object
overit.geocallapp.utilities.dataaccess.DBUtils
Utility class providing database operations and field resolution functionality.
This class offers static methods for database transaction management and field resolution operations.
This class offers static methods for database transaction management and field resolution operations.
- Since:
- 1.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCommits a database transaction with the specified description.getDistinctFieldsExcludingCLOB(DataAttributesHolder dataAttributesHolder, String table, PooledConnection pooledConnection, Company company) Retrieves distinct selectable fields for a single table, excluding CLOB/BLOB fields.getDistinctFieldsExcludingCLOBFromTables(DataAttributesHolder dataAttributesHolder, List<String> tables, PooledConnection pooledConnection, Company company) Retrieves distinct selectable fields for multiple tables, excluding CLOB/BLOB fields.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.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.removeControlFieldsFromDBFields(List<String> dbFields) Removes control fields from the provided list of database fields.static voidRolls back a database transaction with the specified description.
-
Field Details
-
CONNECTION_POOL_NAME
- See Also:
-
-
Method Details
-
commit
Commits a database transaction with the specified description.- Parameters:
description- a descriptive text for the transactionpoolKit- thePoolKit- Throws:
DAException- if a database error occurs during commit
-
rollback
Rolls back a database transaction with the specified description.- Parameters:
description- a descriptive text for the transactionpoolKit- thePoolKit- 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- theDataAttributesHoldercontaining EDM configurationtable- the name of the table to analyzepooledConnection- thePooledConnectionfor database accesscompany- theCompanycontext 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- theDataAttributesHoldercontaining EDM configurationtable- the name of the table to analyzealias- the alias assigned to the table in the querypooledConnection- thePooledConnectionfor database accesscompany- theCompanycontext 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- theDataAttributesHoldercontaining EDM configurationtables- the list of table names to analyzepooledConnection- thePooledConnectionfor database accesscompany- theCompanycontext 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- theDataAttributesHoldercontaining EDM configurationtables- the list of table names to analyzealiases- the list of aliases corresponding to each table (must match table list size)pooledConnection- thePooledConnectionfor database accesscompany- theCompanycontext for the operation- Returns:
- a list of column names that can be selected with DISTINCT across all aliased tables
-
removeControlFieldsFromDBFields
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:
-