com.samskivert.jdbc.depot.clause
Class UpdateClause<T extends PersistentRecord>

java.lang.Object
  extended by com.samskivert.jdbc.depot.clause.QueryClause
      extended by com.samskivert.jdbc.depot.clause.UpdateClause<T>
All Implemented Interfaces:
SQLExpression

public class UpdateClause<T extends PersistentRecord>
extends QueryClause

Builds actual SQL given a main persistent type and some QueryClause objects.


Field Summary
protected  String[] _fields
          The persistent fields to update.
protected  Class<? extends PersistentRecord> _pClass
          The class we're updating.
protected  Object _pojo
          The object from which to fetch values, or null.
protected  SQLExpression[] _values
          The field values, or null.
protected  WhereClause _where
          The where clause.
 
Constructor Summary
UpdateClause(Class<? extends PersistentRecord> pClass, WhereClause where, String[] fields, SQLExpression[] values)
           
UpdateClause(Class<? extends PersistentRecord> pClass, WhereClause where, String[] fields, T pojo)
           
 
Method Summary
 void accept(ExpressionVisitor builder)
          Most uses of this class have been implemented with a visitor pattern.
 void addClasses(Collection<Class<? extends PersistentRecord>> classSet)
          Adds all persistent classes that are brought into the SQL context by this clause: FROM clauses, JOINs, UPDATEs, anything that could create a new table abbreviation.
 String[] getFields()
           
 Class<? extends PersistentRecord> getPersistentClass()
           
 Object getPojo()
           
 SQLExpression[] getValues()
           
 WhereClause getWhereClause()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_pClass

protected Class<? extends PersistentRecord> _pClass
The class we're updating.


_where

protected WhereClause _where
The where clause.


_fields

protected String[] _fields
The persistent fields to update.


_values

protected SQLExpression[] _values
The field values, or null.


_pojo

protected Object _pojo
The object from which to fetch values, or null.

Constructor Detail

UpdateClause

public UpdateClause(Class<? extends PersistentRecord> pClass,
                    WhereClause where,
                    String[] fields,
                    T pojo)

UpdateClause

public UpdateClause(Class<? extends PersistentRecord> pClass,
                    WhereClause where,
                    String[] fields,
                    SQLExpression[] values)
Method Detail

getWhereClause

public WhereClause getWhereClause()

getFields

public String[] getFields()

getValues

public SQLExpression[] getValues()

getPojo

public Object getPojo()

getPersistentClass

public Class<? extends PersistentRecord> getPersistentClass()

addClasses

public void addClasses(Collection<Class<? extends PersistentRecord>> classSet)
Description copied from interface: SQLExpression
Adds all persistent classes that are brought into the SQL context by this clause: FROM clauses, JOINs, UPDATEs, anything that could create a new table abbreviation. This method should recurse into any subordinate state that may in turn bring in new classes so that sub-queries work correctly.


accept

public void accept(ExpressionVisitor builder)
            throws Exception
Description copied from interface: SQLExpression
Most uses of this class have been implemented with a visitor pattern. Create your own ExpressionVisitor and call this method with it.

Throws:
Exception
See Also:
SQLBuilder


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.