AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
java.io.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

Constructors 
Insert​(java.lang.String name, Database database, java.lang.String tableName, java.lang.String[] columnNames)
Creates new Insert object for table with given name with names of columns to fill specified
Insert​(java.lang.String name, Database database, java.lang.String tableName, java.lang.String[] columnNames, java.lang.String[] valueTexts)
Creates new Insert object for table with given name with names of columns to fill specified
Constructor Description

Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods 
abstract void evaluateValues_xjal​(java.lang.Object[] values)
This method should fill values array
int execute()
Performs insertion of one row with current values (provided with evaluateValues_xjal(Object[]) method)
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
java.lang.String toString()  
Modifier and Type Method Description

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 Detail

Insert

public Insert​(java.lang.String name,
              Database database,
              java.lang.String tableName,
              java.lang.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​(java.lang.String name,
              Database database,
              java.lang.String tableName,
              java.lang.String[] columnNames,
              java.lang.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 Detail

evaluateValues_xjal

@AnyLogicInternalCodegenAPI
public abstract void evaluateValues_xjal​(java.lang.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 java.lang.String toString()
Overrides:
toString in class ConnectivityBase
How can we improve this article?