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:
java.io.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
Update(java.lang.String name,
Database database,
java.lang.String tableName,
java.lang.String keyColumnName,
java.lang.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 |
Constructor | Description |
---|
abstract void |
evaluateValues_xjal(java.lang.Object[] keyValues,
java.lang.Object[][] updateValues) |
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() |
|
java.lang.String |
toString() |
|
Modifier and Type | Method | Description |
---|
destroy, getName
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Update(java.lang.String name, Database database, java.lang.String tableName, java.lang.String keyColumnName, java.lang.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(java.lang.Object[] keyValues, java.lang.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()
Resets this object (after multiple update operations) - releases
resources
May be called after all
Called automatically on underlying
May be called after all
execute()
operations completed.Called automatically on underlying
Database
destroy and disconnectpublic java.lang.String toString()
- Overrides:
toString
in classConnectivityBase
-
How can we improve this article?
-