org.h2.command.dml
Class Merge

java.lang.Object
  extended by org.h2.command.Prepared
      extended by org.h2.command.dml.Merge

public class Merge
extends Prepared

This class represents the statement MERGE


Field Summary
 
Fields inherited from class org.h2.command.Prepared
headPos, parameters, prepareAlways, session, sqlStatement
 
Constructor Summary
Merge(Session session)
           
 
Method Summary
 void addRow(Expression[] expr)
          Add a row to this merge statement.
 java.lang.String getPlanSQL()
          Get the SQL statement with the execution plan.
 boolean isTransactional()
          Check if this command is transactional.
 void prepare()
          Prepare this statement.
 LocalResult queryMeta()
          Get an empty result set containing the meta data.
 void setColumns(Column[] columns)
           
 void setCommand(Command command)
          Set the command.
 void setKeys(Column[] keys)
           
 void setQuery(Query query)
           
 void setTable(Table table)
           
 int update()
          Execute the statement.
 
Methods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getSQL, getSQL, getSQL, isQuery, isReadOnly, needRecompile, query, setCurrentRowNumber, setHeadPos, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, setSQL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Merge

public Merge(Session session)
Method Detail

setCommand

public void setCommand(Command command)
Description copied from class: Prepared
Set the command.

Overrides:
setCommand in class Prepared
Parameters:
command - the new command

setTable

public void setTable(Table table)

setColumns

public void setColumns(Column[] columns)

setKeys

public void setKeys(Column[] keys)

setQuery

public void setQuery(Query query)

addRow

public void addRow(Expression[] expr)
Add a row to this merge statement.

Parameters:
expr - the list of values

update

public int update()
           throws java.sql.SQLException
Description copied from class: Prepared
Execute the statement.

Overrides:
update in class Prepared
Returns:
the update count
Throws:
java.sql.SQLException - if it is a query

getPlanSQL

public java.lang.String getPlanSQL()
Description copied from class: Prepared
Get the SQL statement with the execution plan.

Overrides:
getPlanSQL in class Prepared
Returns:
the execution plan

prepare

public void prepare()
             throws java.sql.SQLException
Description copied from class: Prepared
Prepare this statement.

Overrides:
prepare in class Prepared
Throws:
java.sql.SQLException

isTransactional

public boolean isTransactional()
Description copied from class: Prepared
Check if this command is transactional. If it is not, then it forces the current transaction to commit.

Specified by:
isTransactional in class Prepared
Returns:
true if it is

queryMeta

public LocalResult queryMeta()
Description copied from class: Prepared
Get an empty result set containing the meta data.

Specified by:
queryMeta in class Prepared
Returns:
an empty result set