/**
  * Performs a deletion of persisten objects.
  *
  * @return int
  */
 function delete()
 {
     $deleteQuery = new DeleteQuery($this->entity->getPhysicalSchema()->getTable());
     $deleteQuery->setCondition($this->toExpression());
     $affected = $this->entity->getDao()->executeQuery($deleteQuery);
     return $affected;
 }