java.lang.Object
com.broadleafcommerce.enterprise.workflow.admin.service.rebalance.OracleRebalanceDialect
All Implemented Interfaces:
RebalanceDialect

@Component("blOracleRebalanceDialect") public class OracleRebalanceDialect extends Object implements RebalanceDialect
Rebalances adorned target tables in Oracle
Author:
Jeff Fischer
See Also:
  • Constructor Details

    • OracleRebalanceDialect

      public OracleRebalanceDialect()
  • Method Details

    • canHandle

      public boolean canHandle(org.hibernate.dialect.Dialect hibernateDialect)
      Description copied from interface: RebalanceDialect
      Whether or not this instance is appropriate for the RDBMS platform described by the hibernate dialect
      Specified by:
      canHandle in interface RebalanceDialect
      Parameters:
      hibernateDialect - the dialect describing the RDBMS platform
      Returns:
      whether or not this instance is appropriate
    • createRebalanceQuery

      public String[] createRebalanceQuery(String tableName, String idColumn, String sortColumn, String whereClause, BigDecimal startValue, BigDecimal increment)
      Description copied from interface: RebalanceDialect
      Create one or more native sql queries to execute against the target platform. The resulting queries will cause a batch update of the table, renumbering the sort column.
      Specified by:
      createRebalanceQuery in interface RebalanceDialect
      Parameters:
      tableName - the target database table
      idColumn - the primary key column of the table
      sortColumn - the column to renumber
      whereClause - the where clause fragment defining the bounds of the operation (if any, can be null). For example DISPLAY_ORDER > 1 AND DISPLAY_ORDER < 2.
      startValue - the value to start with - the first record will get this value
      increment - the value to increase for the next record in the sorted list based on the value of the previous record
      Returns:
      the complete update queries
    • createDetectNonIntegerSortQuery

      public String createDetectNonIntegerSortQuery(String tableName, String sortColumn, String whereClause)
      Description copied from interface: RebalanceDialect
      Create a native sql query to detect if there are any sort values (given the restrictions of the where clause) that are non-integer.
      Specified by:
      createDetectNonIntegerSortQuery in interface RebalanceDialect
      Parameters:
      tableName - the target database table
      sortColumn - the column to renumber
      whereClause - the where clause fragment defining the bounds of the operation
      Returns:
      A query that returns a single column with a value of 1 or 0 (contains non-integers, or not, respectively)