com.mysema.query.sql.dml
Class SQLUpdateClause

java.lang.Object
  extended by com.mysema.query.sql.dml.AbstractSQLClause
      extended by com.mysema.query.sql.dml.SQLUpdateClause
All Implemented Interfaces:
DMLClause<SQLUpdateClause>, StoreClause<SQLUpdateClause>, UpdateClause<SQLUpdateClause>, FilteredClause<SQLUpdateClause>

public class SQLUpdateClause
extends AbstractSQLClause
implements UpdateClause<SQLUpdateClause>

SQLUpdateClause defines a UPDATE clause

Author:
tiwe

Field Summary
 
Fields inherited from class com.mysema.query.sql.dml.AbstractSQLClause
configuration
 
Constructor Summary
SQLUpdateClause(Connection connection, Configuration configuration, RelationalPath<?> entity)
           
SQLUpdateClause(Connection connection, SQLTemplates templates, RelationalPath<?> entity)
           
 
Method Summary
 SQLUpdateClause addBatch()
          Add the current state of bindings as a batch item
 SQLUpdateClause addFlag(QueryFlag.Position position, String flag)
          Add the given String literal at the given position as a query flag
 long execute()
          Execute the clause and return the amount of affected rows
 SQLUpdateClause populate(Object bean)
          Populate the UPDATE clause with the properties of the given bean.
 SQLUpdateClause set(List<? extends Path<?>> paths, List<?> values)
          Set the paths to be updated
<T> SQLUpdateClause
set(Path<T> path, Expression<? extends T> expression)
          Add an expression binding
<T> SQLUpdateClause
set(Path<T> path, T value)
          Add a value binding
<T> SQLUpdateClause
setNull(Path<T> path)
          Bind the given path to null
 String toString()
           
 SQLUpdateClause where(Predicate... o)
          Adds the given filter conditions
 
Methods inherited from class com.mysema.query.sql.dml.AbstractSQLClause
close, close, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLUpdateClause

public SQLUpdateClause(Connection connection,
                       SQLTemplates templates,
                       RelationalPath<?> entity)

SQLUpdateClause

public SQLUpdateClause(Connection connection,
                       Configuration configuration,
                       RelationalPath<?> entity)
Method Detail

addFlag

public SQLUpdateClause addFlag(QueryFlag.Position position,
                               String flag)
Add the given String literal at the given position as a query flag

Parameters:
position -
flag -
Returns:

addBatch

public SQLUpdateClause addBatch()
Add the current state of bindings as a batch item

Returns:

execute

public long execute()
Description copied from interface: DMLClause
Execute the clause and return the amount of affected rows

Specified by:
execute in interface DMLClause<SQLUpdateClause>
Returns:

set

public <T> SQLUpdateClause set(Path<T> path,
                               T value)
Description copied from interface: StoreClause
Add a value binding

Specified by:
set in interface StoreClause<SQLUpdateClause>
Parameters:
path - path to be updated
value - value to set
Returns:

set

public <T> SQLUpdateClause set(Path<T> path,
                               Expression<? extends T> expression)
Description copied from interface: StoreClause
Add an expression binding

Specified by:
set in interface StoreClause<SQLUpdateClause>
Returns:

setNull

public <T> SQLUpdateClause setNull(Path<T> path)
Description copied from interface: StoreClause
Bind the given path to null

Specified by:
setNull in interface StoreClause<SQLUpdateClause>
Returns:

set

public SQLUpdateClause set(List<? extends Path<?>> paths,
                           List<?> values)
Description copied from interface: UpdateClause
Set the paths to be updated

Specified by:
set in interface UpdateClause<SQLUpdateClause>
Returns:

where

public SQLUpdateClause where(Predicate... o)
Description copied from interface: FilteredClause
Adds the given filter conditions

Specified by:
where in interface FilteredClause<SQLUpdateClause>
Parameters:
o - filter conditions to be added
Returns:

toString

public String toString()
Overrides:
toString in class Object

populate

public SQLUpdateClause populate(Object bean)
Populate the UPDATE clause with the properties of the given bean. The properties need to match the fields of the clause's entity instance. Primary key columns are skipped in the population.

Parameters:
bean -
Returns:


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.