Skip to content

Commit

Permalink
0005726: Moved supportsParametersInSelect() from dialect to platform
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Mar 9, 2023
1 parent 4444623 commit c81caee
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
Expand Up @@ -93,7 +93,6 @@ abstract public class AbstractSymmetricDialect implements ISymmetricDialect {
protected boolean supportsTransactionViews = false;
protected boolean supportsSubselectsInDelete = true;
protected boolean supportsSubselectsInUpdate = true;
protected boolean supportsParametersInSelect = true;
protected Map<String, String> sqlReplacementTokens = new HashMap<String, String>();
protected String tablePrefixLowerCase;
protected boolean isSpatialTypesEnabled = true;
Expand Down Expand Up @@ -675,13 +674,6 @@ public boolean supportsSubselectsInUpdate() {
return supportsSubselectsInUpdate;
}

/*
* Indicates if this dialect supports parameter markers in select queries.
*/
public boolean supportsParametersInSelect() {
return supportsParametersInSelect;
}

public long insertWithGeneratedKey(String sql, SequenceIdentifier sequenceId) {
return insertWithGeneratedKey(sql, sequenceId, null, null);
}
Expand Down
Expand Up @@ -147,11 +147,6 @@ public List<String> createPurgeSqlForMultipleTables(Node node, TriggerRouter tri
*/
public boolean supportsSubselectsInUpdate();

/*
* Indicates if this dialect supports parameter markers in select queries.
*/
public boolean supportsParametersInSelect();

/*
* Implement this if the database has some type of cleanup functionality that needs to be run when dropping database objects. An example is Oracle's 'purge
* recyclebin'
Expand Down
Expand Up @@ -1420,7 +1420,7 @@ public List<ExtractRequest> getCompletedTablesForExtractByLoadIdAndNodeId(long l

@Override
public void updateExtractRequestLoadTime(ISqlTransaction transaction, Date loadTime, OutgoingBatch outgoingBatch) {
if (symmetricDialect.supportsParametersInSelect()) {
if (platform.supportsParametersInSelect()) {
transaction.prepareAndExecute(getSql("updateExtractRequestLoadTime"), outgoingBatch.getBatchId(), new Date(),
outgoingBatch.getReloadRowCount() > 0 ? outgoingBatch.getDataRowCount() : 0,
outgoingBatch.getLoadMillis(), outgoingBatch.getBatchId(), new Date(), outgoingBatch.getBatchId(),
Expand All @@ -1447,7 +1447,7 @@ public void updateExtractRequestTransferred(OutgoingBatch batch, long transferMi
ISqlTransaction transaction = null;
try {
transaction = sqlTemplate.startSqlTransaction();
if (symmetricDialect.supportsParametersInSelect()) {
if (platform.supportsParametersInSelect()) {
transaction.prepareAndExecute(getSql("updateExtractRequestTransferred"), batch.getBatchId(), batch.getDataRowCount(), transferMillis,
batch.getBatchId(), batch.getBatchId(), batch.getNodeId(), batch.getLoadId(), batch.getBatchId(), engine.getNodeId());
} else {
Expand Down
Expand Up @@ -445,7 +445,7 @@ public List<TableReloadRequest> collapseTableReloadRequestsByLoadId(List<TableRe
public TableReloadStatus updateTableReloadStatusDataLoaded(ISqlTransaction transaction, long loadId, long batchId, int batchCount, boolean isBulkLoaded) {
int idType = symmetricDialect.getSqlTypeForIds();
int count;
if (symmetricDialect.supportsParametersInSelect()) {
if (platform.supportsParametersInSelect()) {
count = transaction.prepareAndExecute(getSql("updateTableReloadStatusDataLoaded"),
new Object[] { batchId, batchCount, batchId, batchCount, batchId, batchCount,
batchId, batchCount, batchId, batchCount, batchId, batchCount, new Date(),
Expand Down Expand Up @@ -474,7 +474,7 @@ batchId, batchCount, batchId, batchCount, batchId, batchCount, new Date(),

public void updateTableReloadStatusFailed(ISqlTransaction transaction, long loadId, long batchId) {
int idType = symmetricDialect.getSqlTypeForIds();
if (symmetricDialect.supportsParametersInSelect()) {
if (platform.supportsParametersInSelect()) {
transaction.prepareAndExecute(getSql("updateTableReloadStatusFailed"),
new Object[] { batchId, batchId, batchId, loadId },
new int[] { idType, idType, idType, idType });
Expand All @@ -492,7 +492,7 @@ public void updateTableReloadStatusDataCounts(ISqlTransaction transaction, long
String sql;
Object[] args;
int[] types;
if (symmetricDialect.supportsParametersInSelect()) {
if (platform.supportsParametersInSelect()) {
sql = getSql("updateTableReloadStatusDataCounts");
args = new Object[] { startBatchId, endBatchId, dataBatchCount, rowsCount, new Date(), loadId };
types = new int[] { idType, idType, Types.NUMERIC, Types.NUMERIC, Types.TIMESTAMP, idType };
Expand Down
Expand Up @@ -1291,4 +1291,8 @@ public String getSliceTableSql(String columnName, int sliceNum, int totalSlices)
public String getCharSetName() {
return "";
}

public boolean supportsParametersInSelect() {
return true;
}
}
Expand Up @@ -242,4 +242,6 @@ public Object[] getObjectValues(BinaryEncoding encoding, String[] values,
public String getSliceTableSql(String columnName, int sliceNum, int totalSlices);

public String getCharSetName();

public boolean supportsParametersInSelect();
}

0 comments on commit c81caee

Please sign in to comment.