Class Update
java.lang.Object
org.castor.cpa.persistence.sql.query.Update
- All Implemented Interfaces:
QueryObject
Class to generate SQL update query statements.
Note: Be aware that the SQL statement will be invalid without any assignment of for empty compound conditions.
Note: Be aware that the SQL statement will be invalid without any assignment of for empty compound conditions.
- Version:
- $Revision$ $Date: 2009-07-13 17:22:43 (Mon, 13 Jul 2009) $
- Author:
- Ahmad Hassan, Ralf Joachim, Dennis Butterstein
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Get method returning current list of assignments.Get condition that specifies which records to update.Get method returning qualifier currently set.void
setCondition
(Condition condition) Set condition that specifies which records to update.toString()
Method constructing query string.
-
Constructor Details
-
Update
Construct a SQL update statement that updates records of the table provided.- Parameters:
name
- Name of the table in update statement.
-
-
Method Details
-
addAssignment
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
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.
-
getCondition
Get condition that specifies which records to update.- Returns:
- Condition that specifies which records to update.
-
setCondition
Set condition that specifies which records to update.- Parameters:
condition
- Condition that specifies which records to update.
-
getQualifier
Get method returning qualifier currently set.- Returns:
- Qualifier of the table to update records of.
-
getAssignment
Get method returning current list of assignments.- Returns:
- List of assignments.
-
accept
Accept method to handle incoming visitors.- Specified by:
accept
in interfaceQueryObject
- Parameters:
visitor
- Visitor to be handled.
-
toString
Method constructing query string.
-