AnyLogic
Expand
Font size
All Implemented Interfaces:
Serializable

public abstract class Insert
extends DatabaseAccessor
Object performing row insertion to the database table
This object is only available in the AnyLogic Professional
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
execute()finish()Serialized Form

Constructor Summary

ConstructorDescription
Insert(String name, Database database, String tableName, String[] columnNames)
Creates new Insert object for table with given name with names of columns to fill specified
Insert(String name, Database database, String tableName, String[] columnNames, String[] valueTexts)
Creates new Insert object for table with given name with names of columns to fill specified

Method Summary

Modifier and TypeMethodDescription
abstract voidevaluateValues_xjal(Object[] values)
This method should fill values array
intexecute()
Performs insertion of one row with current values (provided with evaluateValues_xjal(Object[]) method)
voidfinish()
Resets this object (after multiple insertion operations) - releases resources.
May be called after all execute() operations completed.
Called automatically on underlying Database destroy and disconnect
StringtoString() 

Methods inherited from class com.anylogic.engine.connectivity.ConnectivityBase

destroy, getName

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Details

Insert

public Insert(String name,
 Database database,
 String tableName,
 String[] columnNames)
Creates new Insert object for table with given name with names of columns to fill specified
Parameters:
name - object name (decoration purpose)
database - the Database object
tableName - the name of the table where new rows will be inserted
columnNames - the array (ordered) of names of the columns being filled in the new inserted rows

Insert

public Insert(String name,
 Database database,
 String tableName,
 String[] columnNames,
 String[] valueTexts)
Creates new Insert object for table with given name with names of columns to fill specified
Parameters:
name - object name (decoration purpose)
database - the Database object
tableName - the name of the table where new rows will be inserted
columnNames - the array (ordered) of names of the columns being filled in the new inserted rows
valueTexts - texts representing values being inserted
This parameter is optional and is used only in the inspect

Method Details

evaluateValues_xjal

@AnyLogicInternalCodegenAPI
public abstract void evaluateValues_xjal(Object[] values)
This method should fill values array
Parameters:
values - array of the same length as in column names array passed to the constructor
Given array is initially dirty. Implementation is responsible to fill all its values

execute

public int execute()
Performs insertion of one row with current values (provided with evaluateValues_xjal(Object[]) method)
Returns:
number of inserted rows (normally 1 row)

finish

public void finish()
Resets this object (after multiple insertion operations) - releases resources.
May be called after all execute() operations completed.
Called automatically on underlying Database destroy and disconnect

toString

public String toString()
Overrides:
toString in class ConnectivityBase