Skip to content

Commit

Permalink
[master] ExpressionQueryMechanism refactor (#2061)
Browse files Browse the repository at this point in the history
Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman committed Feb 12, 2024
1 parent ed51e2b commit 8552822
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public abstract class Expression implements Serializable, Cloneable {
Seting this flag to false will use the lower() function instead. */
public static boolean shouldUseUpperCaseForIgnoreCase = true;

//flag to control SQLSelectStatement generation
private boolean shouldCreateSQLSelectStatement = false;

/**
* Base Expression Constructor. Not generally used by Developers
*/
Expand Down Expand Up @@ -5447,4 +5450,17 @@ public DatabaseMapping getLeafMapping(DatabaseQuery query, ClassDescriptor rootD
return null;
}

public boolean shouldCreateSQLSelectStatement() {
return shouldCreateSQLSelectStatement;
}

/**
* INTERNAL:<p>
* Flag to control SQLSelectStatement generation.<p>
* true - generate. Usually in case of nested select statement in update query.<p>
* false - don't generate (default)
*/
public void setShouldCreateSQLSelectStatement(boolean shouldCreateSQLSelectStatement) {
this.shouldCreateSQLSelectStatement = shouldCreateSQLSelectStatement;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.eclipse.persistence.internal.expressions;

import org.eclipse.persistence.exceptions.ValidationException;
import org.eclipse.persistence.expressions.Expression;
import org.eclipse.persistence.internal.databaseaccess.DatabaseCall;
import org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform;
import org.eclipse.persistence.internal.helper.DatabaseField;
Expand All @@ -37,7 +38,7 @@
* @since TOPLink/Java 1.0
*/
public class SQLUpdateAllStatementForOracleAnonymousBlock extends SQLModifyStatement {
protected Map<DatabaseTable, Map<DatabaseField, Object>> tables_databaseFieldsToValues;
protected Map<DatabaseTable, Map<DatabaseField, Expression>> tables_databaseFieldsToValues;
protected Map<DatabaseTable, List<DatabaseField>> tablesToPrimaryKeyFields;
protected SQLCall selectCall;

Expand All @@ -59,10 +60,10 @@ public void setTablesToPrimaryKeyFields(Map<DatabaseTable, List<DatabaseField>>
public Map<DatabaseTable, List<DatabaseField>> getTablesToPrimaryKeyFields() {
return tablesToPrimaryKeyFields;
}
public void setTables_databaseFieldsToValues(Map<DatabaseTable, Map<DatabaseField, Object>> tables_databaseFieldsToValues) {
public void setTables_databaseFieldsToValues(Map<DatabaseTable, Map<DatabaseField, Expression>> tables_databaseFieldsToValues) {
this.tables_databaseFieldsToValues = tables_databaseFieldsToValues;
}
public Map<DatabaseTable, Map<DatabaseField, Object>> getTables_databaseFieldsToValues() {
public Map<DatabaseTable, Map<DatabaseField, Expression>> getTables_databaseFieldsToValues() {
return tables_databaseFieldsToValues;
}

Expand Down

0 comments on commit 8552822

Please sign in to comment.