Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.access.jdbc
Class SoftDeleteBatchQueryBuilder

    java.lang.Object
      org.apache.cayenne.access.trans.BatchQueryBuilder
          org.apache.cayenne.access.trans.DeleteBatchQueryBuilder
              org.apache.cayenne.access.jdbc.SoftDeleteBatchQueryBuilder

    public class SoftDeleteBatchQueryBuilder

extends DeleteBatchQueryBuilder

Implementation of `DeleteBatchQueryBuilder`, which uses 'soft' delete (runs UPDATE and sets 'deleted' field to true instead-of running SQL DELETE)

Field Summary

Fields inherited from class org.apache.cayenne.access.trans.BatchQueryBuilder
`adapter, trimFunction`

Constructor Summary
`SoftDeleteBatchQueryBuilder(DbAdapter adapter, java.lang.String deletedFieldName)`

Method Summary
`void` | `bindParameters(java.sql.PreparedStatement statement, BatchQuery query)` Binds BatchQuery parameters to the PreparedStatement.
`java.lang.String` | `createSqlString(BatchQuery batch)` Translates BatchQuery into an SQL string formatted to use in a PreparedStatement.
`protected int` | `getFirstParameterIndex(BatchQuery query)`
`protected boolean` | `needSoftDelete(BatchQuery query)`

Methods inherited from class org.apache.cayenne.access.trans.DeleteBatchQueryBuilder
`applyQualifier`

Methods inherited from class org.apache.cayenne.access.trans.BatchQueryBuilder
`appendDbAttribute, getAdapter, getParameterValues, getTrimFunction, setAdapter, setTrimFunction`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SoftDeleteBatchQueryBuilder

    public SoftDeleteBatchQueryBuilder(DbAdapter adapter,
                                       java.lang.String deletedFieldName)

Method Detail

### createSqlString

    public java.lang.String createSqlString(BatchQuery batch)
                                     throws java.io.IOException

  Description copied from class: `BatchQueryBuilder`
  Translates BatchQuery into an SQL string formatted to use in a PreparedStatement.

  Overrides:
    `createSqlString` in class `DeleteBatchQueryBuilder`
  Throws:
    `java.io.IOException`

### getFirstParameterIndex

    protected int getFirstParameterIndex(BatchQuery query)

  Overrides:
    `getFirstParameterIndex` in class `DeleteBatchQueryBuilder`
  Returns:
    index of first parameter in delete clause

### bindParameters

    public void bindParameters(java.sql.PreparedStatement statement,
                               BatchQuery query)
                        throws java.sql.SQLException,
                               java.lang.Exception

  Description copied from class: `DeleteBatchQueryBuilder`
  Binds BatchQuery parameters to the PreparedStatement.

  Overrides:
    `bindParameters` in class `DeleteBatchQueryBuilder`
  Throws:
    `java.sql.SQLException`
    `java.lang.Exception`

### needSoftDelete

    protected boolean needSoftDelete(BatchQuery query)

  Returns:
    whether 'soft' deletion should be used

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Apache Cayenne. All Rights Reserved.