R
- class type which contains members for columns of a row in a tablepublic class DeleteOperation<R> extends ModifyOperation<R>
Constructor and Description |
---|
DeleteOperation(Table<R> table)
Constructs standard sql delete for primary key as:
DELETE FROM table WHERE primary key clause |
DeleteOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for standard sql delete statement as:
DELETE FROM table WHERE ... |
Modifier and Type | Method and Description |
---|---|
int |
delete(java.lang.Object... parameters)
Deletes rows based upon parameters.
|
int |
delete(R row)
Deletes a row.
|
int |
deleteAll(java.util.Collection<R> rows)
Deletes all rows in collection.
|
protected void |
initBaseSql()
Sets base sql with
SqlOperation.setBaseSql(String) . |
void |
notifyCacheModified(R row)
Notifies cache that row has been deleted from database.
|
protected boolean |
notifyCacheModify(R row)
Tests if row is managed by cache.
|
protected java.util.List<CascadeOperation<R,?>> |
prepareCascades(java.lang.reflect.Field field)
Creates and prepares cascade operations based upon cascade annotations for a field.
|
protected void |
writeColumns(R row)
Does nothing since delete statements have no columns.
|
close, execute, getModifyCounts, getRows, getRowsAffected, isBatch, modify, modify, modifyAll, postExecute, postExecuteCascade, preExecute, preExecuteCascade, setBatch, setParameters, setRow, setRows, setRows, setRows, setRowsAffected
cancel, cascade, closeCascades, closeStatement, createRowField, getBaseSql, getCascadeDepth, getConnection, getCustomSql, getNamedParameterMap, getNextParameter, getOperationTime, getParameter, getParameters, getPreparedSql, getPreparedStatement, getQueryTimeout, getRequiredCascades, getSql, getTable, getTargetTable, getTimingId, getWhereAnnotation, getWhereConditionName, getWhereTranslator, initOperationTime, isCached, isCascade, isCascading, isIncludeIdentityColumns, isPrimaryKey, isReadOnly, isRequiredCascade, isTimings, logTimings, prepare, prepareCascades, prepareCheck, prepareStatement, setBaseSql, setCached, setCascade, setCascadeDepth, setCustomSql, setIncludeIdentityColumns, setNamedParameterMap, setNextParameter, setParameter, setQueryTimeout, setReadOnly, setRequiredCascades, setTimingId, setTimings, setWhere, setWhereTranslator, writeParameter, writeParameters, writeWhere
public DeleteOperation(Table<R> table) throws OperationException
table
- delete from this tableOperationException
- if errorpublic DeleteOperation(Table<R> table, java.lang.String whereConditionName) throws OperationException
table
- delete from this tablewhereConditionName
- name of where condition to use ("primaryKey" to delete
by primary key; empty string to delete all rows in table)OperationException
- if errorpublic int delete(R row) throws OperationException
ModifyOperation.modify(Object)
.row
- row to use for parametersModifyOperation.getRowsAffected()
OperationException
- if errorpublic int deleteAll(java.util.Collection<R> rows) throws OperationException
ModifyOperation.modifyAll(Collection)
.rows
- collection of rows to use as parametersModifyOperation.getRowsAffected()
OperationException
- if errorpublic int delete(java.lang.Object... parameters) throws OperationException
ModifyOperation.modify(Object...)
.parameters
- operation parameters as objects (see ModifyOperation.setParameters(Object...)
)OperationException
- if errorprotected void writeColumns(R row) throws OperationException
writeColumns
in class SqlOperation<R>
row
- get column values from this rowOperationException
- if errorprotected void initBaseSql()
SqlOperation.setBaseSql(String)
.protected java.util.List<CascadeOperation<R,?>> prepareCascades(java.lang.reflect.Field field) throws OperationException
prepareCascades
in class SqlOperation<R>
field
- annotation is for this field of row class ROperationException
- if errorprotected boolean notifyCacheModify(R row) throws OperationException
Cache.delete(Object)
.notifyCacheModify
in class ModifyOperation<R>
row
- test this rowOperationException
- if cache reports an errorpublic void notifyCacheModified(R row) throws OperationException
Cache.deleted(Object)
.notifyCacheModified
in class ModifyOperation<R>
row
- row that was deletedOperationException
- if cache reports an error