Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Oracle - initial API and implementation from Oracle TopLink
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;
import org.eclipse.persistence.internal.helper.DatabaseTable;
import org.eclipse.persistence.internal.sessions.AbstractSession;
import org.eclipse.persistence.queries.SQLCall;
import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author Andrei Ilitchev
* @since TOPLink/Java 1.0
*/
public class SQLUpdateAllStatementForOracleAnonymousBlock extends SQLModifyStatement {
protected Map> tables_databaseFieldsToValues;
protected Map> tablesToPrimaryKeyFields;
protected SQLCall selectCall;
protected static final String varSuffix = "_VAR";
protected static final String typeSuffix = "_TYPE";
protected static final String tab = " ";
protected static final String dbltab = tab + tab;
protected static final String trpltab = dbltab + tab;
public void setSelectCall(SQLCall selectCall) {
this.selectCall = selectCall;
}
public SQLCall getSelectCall() {
return selectCall;
}
public void setTablesToPrimaryKeyFields(Map> tablesToPrimaryKeyFields) {
this.tablesToPrimaryKeyFields = tablesToPrimaryKeyFields;
}
public Map> getTablesToPrimaryKeyFields() {
return tablesToPrimaryKeyFields;
}
public void setTables_databaseFieldsToValues(Map> tables_databaseFieldsToValues) {
this.tables_databaseFieldsToValues = tables_databaseFieldsToValues;
}
public Map> getTables_databaseFieldsToValues() {
return tables_databaseFieldsToValues;
}
public SQLUpdateAllStatementForOracleAnonymousBlock() {
}
/**
* Append the string containing the SQL insert string for the given table.
*/
@Override
public DatabaseCall buildCall(AbstractSession session) {
SQLCall call = new SQLCall();
call.returnNothing();
Writer writer = new CharArrayWriter(100);
ArrayList mainPrimaryKeys = new ArrayList<>();
mainPrimaryKeys.addAll(tablesToPrimaryKeyFields.get(table));
@SuppressWarnings({"unchecked"})
List allFields = (List) mainPrimaryKeys.clone();
Iterator