<pre>
Example:
boolean succeed = Db.use().delete("user", user);
</pre>
@see #delete(String, String, Record)
19246
public boolean delete(String tableName, Record record) {
		String defaultPrimaryKey = config.dialect.getDefaultPrimaryKey();
		Object t = record.get(defaultPrimaryKey);	// 引入中间变量避免 JDK 8 传参有误
		return deleteByIds(tableName, defaultPrimaryKey, t);
	}
985005
@Override
	public synchronized void delete(long historyId, String tag) throws DatabaseException {
    	try {
			psDeleteTag.setLong(1, historyId);
			psDeleteTag.setString(2, tag);
			psDeleteTag.executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
557921
private void preDelete(User user) throws Exception
   {
      for (UserEventListener listener : listeners)
      {
         listener.preDelete(user);
      }
   }
453982
@Override
    public boolean remove(Object o) {
        Integer id = indexOf((Record) o);
        if(id == null) {
            return false;
        }
        remove(id);
        return true;
    }
278492
def delete_by_query(query)
      rsp = post("<delete><query>#{query}</query></delete>")
      success?(rsp.body) or log_error(rsp.body)
    end
60437
public synchronized int delete (Connection conn, T[] objects)
        throws SQLException
    {
        if (primaryKeys == null) {
            throw new IllegalStateException(
                "No primary key for table " + name + ".");
        }
        int nDeleted = 0;
        StringBuilder sql = new StringBuilder(
            "delete from " + name + " where " + primaryKeys[0] + " = ?");
        for (int i = 1; i < primaryKeys.length; i++) {
            sql.append(" and ").append(primaryKeys[i]).append(" = ?");
        }
        PreparedStatement deleteStmt = conn.prepareStatement(sql.toString());
        for (int i = 0; i < objects.length; i++) {
            for (int j = 0; j < primaryKeys.length; j++) {
                fields[primaryKeyIndices[j]].bindVariable(
                    deleteStmt, objects[i], j+1);
            }
            deleteStmt.addBatch();
        }
        int rc[] = deleteStmt.executeBatch();
        for (int k = 0; k < rc.length; k++) {
            nDeleted += rc[k];
        }
        deleteStmt.close();
        return nDeleted;
    }
866458
private void postDelete(User user) throws Exception
   {
      for (UserEventListener listener : listeners)
      {
         listener.postDelete(user);
      }
   }
10855
void executeBulkDelete(final TSDB tsdb, HttpQuery query) {
    try {
      final AnnotationBulkDelete delete_request;
      if (query.hasContent()) {
        delete_request = query.serializer().parseAnnotationBulkDeleteV1();
      } else {
        delete_request = parseBulkDeleteQS(query);
      }
      
      // validate the start time on the string. Users could request a timestamp of
      // 0 to delete all annotations, BUT we don't want them doing that accidentally
      if (delete_request.start_time == null || delete_request.start_time.isEmpty()) {
        throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, 
            "Missing the start time value");
      }
      if (!delete_request.global && 
          (delete_request.tsuids == null || delete_request.tsuids.isEmpty())) {
        throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, 
            "Missing the TSUIDs or global annotations flag");
      }
      
      final int pre_allocate = delete_request.tsuids != null ? 
          delete_request.tsuids.size() + 1 : 1;
      List<Deferred<Integer>> deletes = new ArrayList<Deferred<Integer>>(pre_allocate);
      if (delete_request.global) {
        deletes.add(Annotation.deleteRange(tsdb, null, 
            delete_request.getStartTime(), delete_request.getEndTime()));
      }
      if (delete_request.tsuids != null) {
        for (String tsuid : delete_request.tsuids) {
          deletes.add(Annotation.deleteRange(tsdb, UniqueId.stringToUid(tsuid), 
              delete_request.getStartTime(), delete_request.getEndTime()));
        }
      }
      
      Deferred.group(deletes).joinUninterruptibly();
      delete_request.total_deleted = 0; // just in case the caller set it
      for (Deferred<Integer> count : deletes) {
        delete_request.total_deleted += count.joinUninterruptibly();
      }
      query.sendReply(query.serializer()
          .formatAnnotationBulkDeleteV1(delete_request));
    } catch (BadRequestException e) {
      throw e;
    } catch (IllegalArgumentException e) {
      throw new BadRequestException(e);
    } catch (RuntimeException e) {
      throw new BadRequestException(e);
    } catch (Exception e) {
      throw new RuntimeException("Shouldn't be here", e);
    }
  }
391162
public int del(String tableName, String field, Object value) throws SQLException {
		return del(Entity.create(tableName).set(field, value));
	}
93212
public function delete ($params = FALSE, &$db = FALSE)
	{
		
		// Get database master for write

		if ($db === FALSE)
		{
			$db	=& $this->getDbMaster ();
		}
		
		// If there is no key value passed set to the object id
		
		if ($params === FALSE)
		{
			$params	= array (
				'where' => array (
					array (static::$pk, $this->iget (static::$pk))
				)
			);
		}
		
		// If the params are not an array assume the variable
		// is an object pk, and set the parameter array
		
		if (!is_array ($params))
		{
			$params	= array (
				'where' => array (
					array (static::$pk, $params)
				)
			);
		}
		
		// If there is no where clause
		
		if (!isset ($params['where']))
		{
			throw new Exception ('No where clause for ' . get_called_class () . '->delete');
		}
		
		// Changelog
		
		$arrRemove	= FALSE;
		
		// Get all objects being removed
		
		if ($this->changelog ('delete'))
		{
			$arrRemove	= static::_getObjects (array ('where' => $params['where']), FALSE, $db);
		}
		
		// Prepare query
		
		$query = $db->prepare ('
			DELETE FROM `' . static::$dbTable . '` 
			' . $db->genClause ('WHERE', $db->genWHERE ($params['where']))
		);
		
		// Bind values
		
		$db->genBindValues ($query, $params['where']);
		
		// Execute

		$query->execute ();
		
		// Changelog
		
		if ($arrRemove)
		{
			
			$log =& $this->getResource ('changelog');
			$log->hookTransactions ($db);
			
			// Log all removed entries
			
			foreach ($arrRemove as $obj)
			{
				$log::_Log ('delete', $obj);
			}
			
		}

		// return TRUE

		return TRUE;
		
	}
1207293
public int deleteByExtension(String extensionName, String tableName)
			throws SQLException {

		DeleteBuilder<Extensions, Void> db = deleteBuilder();

		setUniqueWhere(db.where(), extensionName, true, tableName, false, null);

		int deleted = db.delete();

		return deleted;
	}
480413
public void delete(RecordId dataRecordId) {
		// search range must be a constant
		if (!searchRange.isSingleValue())
			throw new IllegalStateException();

		// delete all entry with the specific key
		while (next())
			if (getDataRecordId().equals(dataRecordId)) {
				// ccMgr.modifyLeafBlock(currentPage.currentBlk());
				delete(currentSlot);
				break;
			}

		if (!isOverflowing) {
			/*
			 * If the current regular block is empty or the key of the first
			 * record is not equal to that of records in overflow blocks,
			 * transfer one record from a overflow block to here (if any).
			 */
			if (getOverflowFlag(currentPage) != -1) {
				// get overflow page
				BlockId blk = new BlockId(currentPage.currentBlk().fileName(), getOverflowFlag(currentPage));
				ccMgr.modifyLeafBlock(blk);
				BTreePage overflowPage = new BTreePage(blk, NUM_FLAGS, schema, tx);

				SearchKey firstKey = getKey(currentPage, 0, keyType.length());
				if ((currentPage.getNumRecords() == 0
						|| (overflowPage.getNumRecords() != 0
						&& getKey(overflowPage, 0, keyType.length()) != firstKey))) {
					overflowPage.transferRecords(overflowPage.getNumRecords() - 1,
							currentPage, 0, 1);
					// if the overflow block is empty, make it a dead block
					if (overflowPage.getNumRecords() == 0) {
						long overflowFlag = (getOverflowFlag(overflowPage)
								== currentPage.currentBlk().number())
								? -1 : getOverflowFlag(overflowPage);
						setOverflowFlag(currentPage, overflowFlag);
					}
					overflowPage.close();
				}
			}
		} else {
			/*
			 * If the current overflow block is empty, make it a dead block.
			 */
			if (currentPage.getNumRecords() == 0) {
				// reset the overflow flag of original page
				BlockId blk = new BlockId(currentPage.currentBlk().fileName(), moveFrom);
				// ccMgr.modifyLeafBlock(blk);
				BTreePage prePage = new BTreePage(blk, NUM_FLAGS, schema, tx);
				long overflowFlag = (getOverflowFlag(currentPage) == prePage.currentBlk().number()) ? -1
						: getOverflowFlag(currentPage);
				setOverflowFlag(prePage, overflowFlag);
				prePage.close();
			}
		}
	}
799646
public ResultSet delete(final Class<?> targetClass, final Collection<String> deletingPropNames, final Condition whereCause) {
        final CP pair = prepareDelete(targetClass, deletingPropNames, whereCause);

        return this.execute(pair.cql, pair.parameters.toArray());
    }
1186659
public boolean delete(String name, boolean bankAccount) {
        boolean result = false;
        if (exist(name, bankAccount)) {
            result = Common.getInstance().getStorageHandler().getStorageEngine().deleteAccount(name, bankAccount);
            if (bankAccount) {
                bankList.remove(name);
            } else {
                accountList.remove(name);
            }
        }
        return result;
    }
1029500
public int deleteById(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException {
		try {
			Object[] args = new Object[] { convertIdToFieldObject(id) };
			int rowC = databaseConnection.delete(statement, args, argFieldTypes);
			logger.debug("delete data with statement '{}' and {} args, changed {} rows", statement, args.length, rowC);
			if (args.length > 0) {
				// need to do the (Object) cast to force args to be a single object
				logger.trace("delete arguments: {}", (Object) args);
			}
			if (rowC > 0 && objectCache != null) {
				objectCache.remove(clazz, id);
			}
			return rowC;
		} catch (SQLException e) {
			throw SqlExceptionUtil.create("Unable to run deleteById stmt on id " + id + ": " + statement, e);
		}
	}
384535
@Override
	public int delete(DataColumnConstraints dataColumnConstraints)
			throws SQLException {

		DeleteBuilder<DataColumnConstraints, Void> db = deleteBuilder();

		setUniqueWhere(db.where(), dataColumnConstraints.getConstraintName(),
				dataColumnConstraints.getConstraintType(),
				dataColumnConstraints.getValue());

		int deleted = db.delete();

		return deleted;
	}
1256455
public function delete()
    {
        if ($this->deleteStatement == null) {
            $this->deleteStatement = $this->connection->prepare("DELETE FROM User WHERE username = ?");
            $this->deleteStatement->bindParam(1, $this->username);
        }
        try{
            $this->deleteStatement->execute();
        } catch (PDOException $exception){
            return false;
        }
        if ($this->exists()) {
            return false;
        }
        $this->notifyObservers(User::EVENT_DELETE);
        return true;
    }