butler.sql.query
Class DeleteQuery

java.lang.Object
  extended by butler.sql.query.Query
      extended by butler.sql.query.DeleteQuery
All Implemented Interfaces:
Joinable, java.lang.Cloneable

public class DeleteQuery
extends Query

Query for deleting records.

Author:
Fredrik Bertilsson

Nested Class Summary
static class DeleteQuery.DeleteQueryInstance
           
 
Field Summary
 
Fields inherited from class butler.sql.query.Query
_cols, _comparator, _filter, _maxNoOfRec, _name, _table, _uniqueSort
 
Constructor Summary
DeleteQuery(Table tab)
           
 
Method Summary
 void addColumn(Column col)
          Adds a column to retrieve.
 void addSortCriteria(Column col, boolean ascending)
          Add sort-critera (order by) to query.
 void addSortCriteria(Index index, boolean ascending)
          Add sort-critera (order by) to query.
 QueryInstance createInstance()
          Creates a instance of this query.
 java.util.List getJoins()
          Returns the joins for this query.
 java.lang.String getSQL()
          Returns the resulting select SQL statement.
 boolean isCascade()
           
 Join join(ForeignKey fk)
          Joins another table to this query by a given foreign key.
 Join join(Table table)
          Joins another table to this query by a given table.
 Join outerJoin(ForeignKey fk)
          Joins another table to this query by a given foreign key, using left outer join.
 void setCascade(boolean cascade)
           
 
Methods inherited from class butler.sql.query.Query
addColumn, addFunctionColumn, addSortCriteria, addSortCriteria, addSubQuery, checkPermission, copy, createTableDictonary, getColumn, getColumns, getComparator, getFilter, getFilter, getHaving, getJoinByAlias, getMainTable, getMaxNoOfRecords, getName, getPhysicalColumns, getSortCriterias, getSubQueries, getTable, getUnions, is2D, isNested, isUnion, isUniqueSort, join, join, modifyFilter, newIterator, outerJoin, outerJoin, parse, parse, parseQuery, recursiveJoin, registerJoin, run, setAggregate, setAlias, setDistinct, setFilter, setHaving, setMaxNoOfRecords, setName, setNested, setRecordComparator, setSortCriterias, setUnion, setUniqueSort, toXML, toXML, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteQuery

public DeleteQuery(Table tab)
            throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

addColumn

public void addColumn(Column col)
Description copied from class: Query
Adds a column to retrieve.

Overrides:
addColumn in class Query

setCascade

public void setCascade(boolean cascade)

isCascade

public boolean isCascade()

join

public Join join(ForeignKey fk)
          throws java.lang.Exception
Description copied from class: Query
Joins another table to this query by a given foreign key. Returns the resulting join.

Specified by:
join in interface Joinable
Overrides:
join in class Query
Throws:
java.lang.Exception

outerJoin

public Join outerJoin(ForeignKey fk)
               throws java.lang.Exception
Description copied from class: Query
Joins another table to this query by a given foreign key, using left outer join. Returns the resulting join.

Specified by:
outerJoin in interface Joinable
Overrides:
outerJoin in class Query
Throws:
java.lang.Exception

join

public Join join(Table table)
          throws java.lang.Exception
Description copied from class: Query
Joins another table to this query by a given table. If there are more than one foreign keys between the main table and this, an exception will occur. Returns the resulting join.

Overrides:
join in class Query
Throws:
java.lang.Exception

getJoins

public java.util.List getJoins()
Description copied from class: Query
Returns the joins for this query.

Overrides:
getJoins in class Query

addSortCriteria

public void addSortCriteria(Column col,
                            boolean ascending)
                     throws java.lang.Exception
Description copied from class: Query
Add sort-critera (order by) to query.

Overrides:
addSortCriteria in class Query
Throws:
java.lang.Exception

addSortCriteria

public void addSortCriteria(Index index,
                            boolean ascending)
                     throws java.lang.Exception
Description copied from class: Query
Add sort-critera (order by) to query.

Overrides:
addSortCriteria in class Query
Throws:
java.lang.Exception

createInstance

public QueryInstance createInstance()
Description copied from class: Query
Creates a instance of this query.

Overrides:
createInstance in class Query

getSQL

public java.lang.String getSQL()
                        throws java.lang.Exception
Description copied from class: Query
Returns the resulting select SQL statement.

Overrides:
getSQL in class Query
Throws:
java.lang.Exception