Class OracleRebalanceDialect
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(org.hibernate.dialect.Dialect hibernateDialect) Whether or not this instance is appropriate for the RDBMS platform described by the hibernate dialectcreateDetectNonIntegerSortQuery(String tableName, String sortColumn, String whereClause) Create a native sql query to detect if there are any sort values (given the restrictions of the where clause) that are non-integer.String[]createRebalanceQuery(String tableName, String idColumn, String sortColumn, String whereClause, BigDecimal startValue, BigDecimal increment) Create one or more native sql queries to execute against the target platform.
-
Constructor Details
-
OracleRebalanceDialect
public OracleRebalanceDialect()
-
-
Method Details
-
canHandle
public boolean canHandle(org.hibernate.dialect.Dialect hibernateDialect) Description copied from interface:RebalanceDialectWhether or not this instance is appropriate for the RDBMS platform described by the hibernate dialect- Specified by:
canHandlein interfaceRebalanceDialect- 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:RebalanceDialectCreate 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:
createRebalanceQueryin interfaceRebalanceDialect- Parameters:
tableName- the target database tableidColumn- the primary key column of the tablesortColumn- the column to renumberwhereClause- 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 valueincrement- 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:RebalanceDialectCreate 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:
createDetectNonIntegerSortQueryin interfaceRebalanceDialect- Parameters:
tableName- the target database tablesortColumn- the column to renumberwhereClause- 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)
-