com.xj.anylogic.engine.connectivity
Class Insert

java.lang.Object
  extended by com.xj.anylogic.engine.connectivity.Insert
All Implemented Interfaces:
java.io.Serializable

public abstract class Insert
extends java.lang.Object

Object performing row insertion to the database table
This object is only available in the AnyLogic Professional

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
execute(), finish(), Serialized Form

Constructor Summary
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
 
Method Summary
 void destroy()
          Releases resources acquired by this object
Also destroys all not destroyed contributors associated with this object

Doest nothing if object is already destroyed
abstract  void evaluateValues(java.lang.Object[] values)
          This method should fill values array
 int execute()
          Performs insertion of one row with current values (provided with evaluateValues(Object[]) method)
 void finish()
          Resets this object (after multiple insertion operations) - releases resources.
 java.lang.String getName()
          Returns the name of this object
 java.lang.String toString()
           
 
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

public abstract void evaluateValues(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(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()

getName

public final java.lang.String getName()
Returns the name of this object

Returns:
the name of this object

destroy

public final void destroy()
Releases resources acquired by this object
Also destroys all not destroyed contributors associated with this object

Doest nothing if object is already destroyed



Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.