com.uwyn.rife.database.queries
Class Update

java.lang.Object
  extended by com.uwyn.rife.database.queries.AbstractWhereQuery<Update>
      extended by com.uwyn.rife.database.queries.Update
All Implemented Interfaces:
Query, Cloneable

public class Update
extends AbstractWhereQuery<Update>
implements Cloneable

Object representation of a SQL "UPDATE" query.

This object may be used to dynamically construct a SQL statement in a database-independent fashion. After it is finished, it may be executed using DbQueryManager.executeUpdate().

Since:
1.0
Version:
$Revision: 3648 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com), Steven Grimm (koreth[remove] at midwinter dot com)

Field Summary
protected  Datasource mDatasource
           
protected  boolean mExcludeUnsupportedCapabilities
           
protected  String mSql
           
 
Fields inherited from class com.uwyn.rife.database.queries.AbstractWhereQuery
mWhere
 
Constructor Summary
Update(Datasource datasource)
           
 
Method Summary
protected  Update _field(String field, Object value)
           
protected  void _fieldSubselect(Select query)
           
protected  void _tableSubselect(Select query)
           
protected  void _unionSubselect(Select query)
           
protected  void _whereSubselect(Select query)
           
protected  void addFieldParameter(String field)
           
protected  void addWhereParameter(String field)
           
 void addWhereParameters(List<String> parameters)
           
 void addWhereParameters(List<String> parameters)
           
 void clear()
           
protected  void clearGenerated()
           
protected  void clearWhereParameters()
           
 Update clone()
           
 Update field(String field, boolean value)
           
 Update field(String field, byte value)
           
 Update field(String field, char value)
           
 Update field(String field, double value)
           
 Update field(String field, float value)
           
 Update field(String field, int value)
           
 Update field(String field, long value)
           
 Update field(String field, Object value)
           
 Update field(String field, Select query)
           
 Update field(String field, short value)
           
 Update fieldCustom(String field, String expression)
           
 Update fieldParameter(String field)
           
 Update fieldParameter(String field, String alias)
           
 Update fields(Object bean)
           
 Update fields(Object[] keyValues)
           
 Update fieldsExcluded(Object bean, String[] excludedFields)
           
 Update fieldsFiltered(Object bean, String[] includedFields, String[] excludedFields)
           
 Update fieldsIncluded(Object bean, String[] includedFields)
           
 Update fieldsParameters(Class beanClass)
           
 Update fieldsParametersExcluded(Class beanClass, String[] excludedFields)
           
 Update fieldSubselect(Select query)
           
 com.uwyn.rife.database.capabilities.Capabilities getCapabilities()
           
 Datasource getDatasource()
           
 Map<String,Object> getFields()
           
 String getHint()
           
 String getLimitParameter()
           
 String getOffsetParameter()
           
 QueryParameters getParameters()
           
 String getSql()
           
 String getTable()
           
protected  List<String> getWhereParameters()
           
 Update hint(String hint)
           
protected  boolean isLimitBeforeOffset()
           
 void setExcludeUnsupportedCapabilities(boolean flag)
           
protected  void setLimitParameter(String limitParameter)
           
protected  void setOffsetParameter(String offsetParameter)
           
 Update table(String table)
           
 String toString()
           
 
Methods inherited from class com.uwyn.rife.database.queries.AbstractWhereQuery
getWhere, startWhere, startWhereAnd, startWhereOr, where, where, where, where, where, where, where, where, where, where, where, where, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereAnd, whereExcluded, whereFiltered, whereIncluded, whereOr, whereOr, whereOr, whereOr, whereOr, whereOr, whereOr, whereOr, whereOr, whereOr, whereOr, whereParameter, whereParameter, whereParameterAnd, whereParameterAnd, whereParameterOr, whereParameterOr, whereParameters, whereParametersExcluded, whereSubselect
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.uwyn.rife.database.queries.Query
setExcludeUnsupportedCapabilities
 

Field Detail

mDatasource

protected Datasource mDatasource

mSql

protected String mSql

mExcludeUnsupportedCapabilities

protected boolean mExcludeUnsupportedCapabilities
Constructor Detail

Update

public Update(Datasource datasource)
Method Detail

clear

public void clear()
Specified by:
clear in interface Query
Overrides:
clear in class AbstractWhereQuery<Update>

getHint

public String getHint()

getTable

public String getTable()

getFields

public Map<String,Object> getFields()

getCapabilities

public com.uwyn.rife.database.capabilities.Capabilities getCapabilities()
Specified by:
getCapabilities in interface Query

getSql

public String getSql()
Specified by:
getSql in interface Query

hint

public Update hint(String hint)

table

public Update table(String table)

fieldSubselect

public Update fieldSubselect(Select query)

_field

protected Update _field(String field,
                        Object value)

fieldParameter

public Update fieldParameter(String field)

fieldParameter

public Update fieldParameter(String field,
                             String alias)

field

public Update field(String field,
                    char value)

field

public Update field(String field,
                    boolean value)

field

public Update field(String field,
                    byte value)

field

public Update field(String field,
                    double value)

field

public Update field(String field,
                    float value)

field

public Update field(String field,
                    int value)

field

public Update field(String field,
                    long value)

field

public Update field(String field,
                    short value)

field

public Update field(String field,
                    Select query)

fieldCustom

public Update fieldCustom(String field,
                          String expression)

field

public Update field(String field,
                    Object value)

fields

public Update fields(Object[] keyValues)

fields

public Update fields(Object bean)
              throws DbQueryException
Throws:
DbQueryException

fieldsIncluded

public Update fieldsIncluded(Object bean,
                             String[] includedFields)
                      throws DbQueryException
Throws:
DbQueryException

fieldsExcluded

public Update fieldsExcluded(Object bean,
                             String[] excludedFields)
                      throws DbQueryException
Throws:
DbQueryException

fieldsFiltered

public Update fieldsFiltered(Object bean,
                             String[] includedFields,
                             String[] excludedFields)
                      throws DbQueryException
Throws:
DbQueryException

fieldsParameters

public Update fieldsParameters(Class beanClass)
                        throws DbQueryException
Throws:
DbQueryException

fieldsParametersExcluded

public Update fieldsParametersExcluded(Class beanClass,
                                       String[] excludedFields)
                                throws DbQueryException
Throws:
DbQueryException

clone

public Update clone()
Overrides:
clone in class AbstractWhereQuery<Update>

addWhereParameters

public void addWhereParameters(List<String> parameters)

_fieldSubselect

protected void _fieldSubselect(Select query)

_tableSubselect

protected void _tableSubselect(Select query)

_whereSubselect

protected void _whereSubselect(Select query)

_unionSubselect

protected void _unionSubselect(Select query)

getParameters

public QueryParameters getParameters()
Specified by:
getParameters in interface Query

addFieldParameter

protected void addFieldParameter(String field)

clearWhereParameters

protected void clearWhereParameters()

addWhereParameter

protected void addWhereParameter(String field)

getWhereParameters

protected List<String> getWhereParameters()

addWhereParameters

public void addWhereParameters(List<String> parameters)

setLimitParameter

protected void setLimitParameter(String limitParameter)

getLimitParameter

public String getLimitParameter()

setOffsetParameter

protected void setOffsetParameter(String offsetParameter)

getOffsetParameter

public String getOffsetParameter()

isLimitBeforeOffset

protected boolean isLimitBeforeOffset()

getDatasource

public Datasource getDatasource()

setExcludeUnsupportedCapabilities

public void setExcludeUnsupportedCapabilities(boolean flag)
Specified by:
setExcludeUnsupportedCapabilities in interface Query

clearGenerated

protected void clearGenerated()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.