Package com.anylogic.engine.connectivity
- java.lang.Object
- com.anylogic.engine.connectivity.ConnectivityBase
- com.anylogic.engine.connectivity.DatabaseAccessor
- com.anylogic.engine.connectivity.Update
- All Implemented Interfaces:
Serializable
public abstract class Update extends DatabaseAccessor
Object performing rows update in the database table
This object is only available in the AnyLogic Professional
This object is only available in the AnyLogic Professional
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
-
execute()
finish()
Serialized Form
Constructor | Description |
---|---|
Update |
Creates new
Update object for table with given name with names of
key column to be checked and columns to be updated specified |
Modifier and Type | Method | Description |
---|---|---|
abstract void | evaluateValues_xjal |
This method should be overridden to fill
keyValues and
updateValues arrays |
int | execute() |
Performs update of rows with current values (provided with
evaluateValues_xjal(Object[], Object[][]) method) |
void | finish() | |
String | toString() |
public Update(String name, Database database, String tableName, String keyColumnName, String[][] columnsToUpdate)
Creates new
Update
object for table with given name with names of
key column to be checked and columns to be updated specified- Parameters:
name
- object name (decoration purpose)database
- the Database objecttableName
- the name of the table to be updatedkeyColumnName
- the name of key columncolumnsToUpdate
- array of column names to be affected by this update. This array is 2-dimensional: first dimension enumerates update-sets which correspond to some values of key column respectively; second dimension enumerates names of updated columns for each update-set. See alsoevaluateValues_xjal(Object[], Object[][])
@AnyLogicInternalCodegenAPI public abstract void evaluateValues_xjal(Object[] keyValues, Object[][] updateValues)
This method should be overridden to fill
keyValues
and
updateValues
arrays- Parameters:
keyValues
- values for key column to be checked when applying updates
array of the same length as first dimension in columnToUpdate array passed to the constructor
Given array is initially dirty. Implementation is responsible to fill all its valuesupdateValues
- values for value columns to be filled when applying update changes when corresponding key-checks succeed
array of the same dimensions as in columnToUpdate array passed to the constructor
Given array is initially dirty. Implementation is responsible to fill all its values
public int execute()
Performs update of rows with current values (provided with
evaluateValues_xjal(Object[], Object[][])
method)- Returns:
- number of modified rows
public void finish()
public String toString()
- Overrides:
toString
in classConnectivityBase