org.eobjects.metamodel.delete
Class AbstractRowDeletionBuilder

java.lang.Object
  extended by org.eobjects.metamodel.delete.AbstractRowDeletionBuilder
All Implemented Interfaces:
WhereClauseBuilder<RowDeletionBuilder>, RowDeletionBuilder

public abstract class AbstractRowDeletionBuilder
extends Object
implements RowDeletionBuilder

Abstract RowDeletionBuilder implementation


Constructor Summary
AbstractRowDeletionBuilder(Table table)
           
 
Method Summary
protected  boolean deleteRow(Row row)
          Determines if a row should be deleted or not (can be used by subclasses as a convenient determinator).
 Table getTable()
          Gets the table that this delete statement pertains to.
protected  List<FilterItem> getWhereItems()
           
protected  boolean isTruncateTableOperation()
          Convenience method to tell subclasses if the delete operation represents a full table truncate operation.
 String toSql()
          Gets a SQL representation of this delete operation.
 String toString()
           
 FilterBuilder<RowDeletionBuilder> where(Column column)
          Defines a where item to set as a criteria
 RowDeletionBuilder where(FilterItem... filterItems)
          Applies where items to set criteria
 RowDeletionBuilder where(Iterable<FilterItem> filterItems)
          Applies where items to set criteria
 FilterBuilder<RowDeletionBuilder> where(String columnName)
          Defines a where item to set as a criteria
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.delete.RowDeletionBuilder
execute
 

Constructor Detail

AbstractRowDeletionBuilder

public AbstractRowDeletionBuilder(Table table)
Method Detail

getWhereItems

protected List<FilterItem> getWhereItems()

where

public FilterBuilder<RowDeletionBuilder> where(Column column)
Description copied from interface: WhereClauseBuilder
Defines a where item to set as a criteria

Specified by:
where in interface WhereClauseBuilder<RowDeletionBuilder>
Parameters:
column - a column to apply a criteria for
Returns:
a builder object for further building the where item

where

public FilterBuilder<RowDeletionBuilder> where(String columnName)
Description copied from interface: WhereClauseBuilder
Defines a where item to set as a criteria

Specified by:
where in interface WhereClauseBuilder<RowDeletionBuilder>
Parameters:
columnName - the name of the colum to which the criteria will be applied
Returns:
a builder object for further building the where item

where

public RowDeletionBuilder where(FilterItem... filterItems)
Description copied from interface: WhereClauseBuilder
Applies where items to set criteria

Specified by:
where in interface WhereClauseBuilder<RowDeletionBuilder>
Parameters:
filterItems - the where items to set
Returns:
the builder object itself, for further building of the update

where

public RowDeletionBuilder where(Iterable<FilterItem> filterItems)
Description copied from interface: WhereClauseBuilder
Applies where items to set criteria

Specified by:
where in interface WhereClauseBuilder<RowDeletionBuilder>
Parameters:
filterItems - the where items to set
Returns:
the builder object, for further building of the update

getTable

public Table getTable()
Description copied from interface: RowDeletionBuilder
Gets the table that this delete statement pertains to.

Specified by:
getTable in interface RowDeletionBuilder
Returns:
the table that this delete statement pertains to.

deleteRow

protected boolean deleteRow(Row row)
Determines if a row should be deleted or not (can be used by subclasses as a convenient determinator).

Parameters:
row -
Returns:
true if the row should be deleted.

isTruncateTableOperation

protected boolean isTruncateTableOperation()
Convenience method to tell subclasses if the delete operation represents a full table truncate operation. Usually such operations can be optimized by simply removing the table (and maybe restoring similar headers in a new table).

Returns:

toString

public String toString()
Overrides:
toString in class Object

toSql

public String toSql()
Description copied from interface: RowDeletionBuilder
Gets a SQL representation of this delete operation. Note that the generated SQL is dialect agnostic, so it is not accurately the same as what will be passed to a potential backing database.

Specified by:
toSql in interface RowDeletionBuilder
Returns:
a SQL representation of this delete operation.


Copyright © 2007-2013. All Rights Reserved.