org.castor.cpa.persistence.sql.query
Class Insert

java.lang.Object
  extended by org.castor.cpa.persistence.sql.query.Insert
All Implemented Interfaces:
QueryObject

public final class Insert
extends java.lang.Object
implements QueryObject

Class to generate SQL Insert query statements.
Note: Be aware that the SQL statement will be invalid without any assignment.

Version:
$Revision: 8994 $ $Date: 2011-08-02 01:40:59 +0200 (Di, 02 Aug 2011) $
Author:
Ahmad Hassan, Ralf Joachim

Constructor Summary
Insert(java.lang.String name)
          Construct a SQL insert statement that inserts into the table.
 
Method Summary
 void accept(Visitor visitor)
          Accept method to handle incoming visitors.
 void addAssignment(Assignment assignment)
          Appends given assignment to the list of Assignment objects.
 void addAssignment(Column column, Expression value)
          Appends an assignment of the given value to the given column.
 java.util.List<Assignment> getAssignment()
          Getter returning list of assignments currently set.
 Qualifier getQualifier()
          Getter returning Qualifier currently set.
 java.lang.String toString()
          Method constructing query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Insert

public Insert(java.lang.String name)
Construct a SQL insert statement that inserts into the table.

Parameters:
name - Name of the table in update statement.
Method Detail

getQualifier

public Qualifier getQualifier()
Getter returning Qualifier currently set.

Returns:
Qualifier currently set.

getAssignment

public java.util.List<Assignment> getAssignment()
Getter returning list of assignments currently set.

Returns:
List of assignments currently set.

addAssignment

public void addAssignment(Assignment assignment)
Appends given assignment to the list of Assignment objects.

Parameters:
assignment - Assignment object added to the list of assignments that will be appended to SET clause of sql statement.

addAssignment

public void addAssignment(Column column,
                          Expression value)
Appends an assignment of the given value to the given column.

Parameters:
column - Column to assign the value to.
value - Expression to be assigned to the column.

accept

public void accept(Visitor visitor)
Accept method to handle incoming visitors.

Specified by:
accept in interface QueryObject
Parameters:
visitor - Visitor to be handled.

toString

public java.lang.String toString()
Method constructing query string.

Overrides:
toString in class java.lang.Object
Returns:
Constructed query string.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com