Delete a Contents by id, cascading optionally including the user table

@param id
id
@param userTable
true if a user table
@return deleted count
@throws SQLException
upon deletion error
335863
public int deleteByIdCascade(String id, boolean userTable)
			throws SQLException {
		int count = 0;
		if (id != null) {
			Contents contents = queryForId(id);
			if (contents != null) {
				count = deleteCascade(contents, userTable);
			} else if (userTable) {
				dropTable(id);
			}
		}
		return count;
	}
1141932
public static void delete(final String id) throws AppPlatformException, IOException {
        assert(id != null);
        final BandwidthClient client = BandwidthClient.getInstance();
        client.delete(client.getUserResourceInstanceUri(BandwidthConstants.DOMAINS_URI_PATH, id));
    }
1167314
public static int delete(Connection connection, String table, String where,
			String[] args) {
		StringBuilder delete = new StringBuilder();
		delete.append("delete from ").append(CoreSQLUtils.quoteWrap(table));
		if (where != null) {
			delete.append(" where ").append(where);
		}
		String sql = delete.toString();

		PreparedStatement statement = null;

		int count = 0;
		try {
			statement = connection.prepareStatement(sql);
			setArguments(statement, args);
			count = statement.executeUpdate();
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to execute SQL delete statement: " + sql, e);
		} finally {
			closeStatement(statement, sql);
		}

		return count;
	}
1046093
public synchronized int delete (Connection conn, T obj)
        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 < primaryKeys.length; i++) {
            fields[primaryKeyIndices[i]].bindVariable(deleteStmt, obj,i+1);
        }
        nDeleted = deleteStmt.executeUpdate();
        deleteStmt.close();
        return nDeleted;
    }
1041412
protected void deleteContent(final List<String> tables, final Statement statement) throws SQLException {

		final ArrayList<String> tempTables = new ArrayList<String>(tables);

		// Loop until all data is deleted: we don't know the correct DROP
		// order, so we have to retry upon failure
		while (!tempTables.isEmpty()) {
			final int sizeBefore = tempTables.size();
			for (final ListIterator<String> iterator = tempTables.listIterator(); iterator.hasNext();) {
				final String table = iterator.next();

				try {
					statement.executeUpdate("DELETE FROM " + table);
					iterator.remove();
				} catch (final SQLException exc) {
					LOG.warn("Ignored exception: " + exc.getMessage() + ". WILL RETRY.");
				}
			}
			if (tempTables.size() == sizeBefore) {
				throw new AssertionError("unable to clean tables " + tempTables);
			}

		}

	}
360405
public int deleteIds(DatabaseConnection databaseConnection, Collection<ID> ids, ObjectCache objectCache)
			throws SQLException {
		// have to build this on the fly because the collection has variable number of args
		int result = MappedDeleteCollection.deleteIds(dao, tableInfo, databaseConnection, ids, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}
774093
@Override
    public void deleteUser(String username) throws AuthenticationException {
        String user = file_store.getProperty(username);
        if (user == null) {
            throw new AuthenticationException("User '" + username
                    + "' not found.");
        }
        file_store.remove(username);
        try {
            saveUsers();
        } catch (IOException e) {
            throw new AuthenticationException("Error deleting user: ", e);
        }
    }
462303
@Override
    public Delete createDelete(URI id, String tableName) throws IOException {
        Delete del = null;
        HTable hTable = getTable(tableName);
        if (hTable != null) {
            del = new Delete(Bytes.toBytes(id.toString()));
        }
        return del;
    }
401242
@Nonnull
  public EChange undeleteUser (@Nullable final String sUserID)
  {
    final User aUser = getOfID (sUserID);
    if (aUser == null)
    {
      AuditHelper.onAuditUndeleteFailure (User.OT, sUserID, "no-such-user-id");
      return EChange.UNCHANGED;
    }

    m_aRWLock.writeLock ().lock ();
    try
    {
      if (BusinessObjectHelper.setUndeletionNow (aUser).isUnchanged ())
        return EChange.UNCHANGED;
      internalMarkItemUndeleted (aUser);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditUndeleteSuccess (User.OT, sUserID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserUndeleted (aUser));

    return EChange.CHANGED;
  }
1137825
public void deleteById(Object id) {

        int count = beginDelete().whereEquals(idColumn.getColumnName(), id).delete();

        if (count == 0) {
            throw new RowNotFoundException(table, id);
        }
    }
1029318
public User getUser(String id) {
        return db.query("SELECT * FROM Users WHERE id = ?",
                new ResultSetExtractor<User>() {
                    public User extractData(ResultSet rs)
                            throws SQLException {
                        if (rs.next()) {
                            return getUser(rs);
                        } else {
                            return null;
                        }
                    }
                },
                Integer.parseInt(id));
    }
372236
def delete(user_id):
        '''
        
        '''
        try:
            del_count = TabMember.delete().where(TabMember.uid == user_id)
            del_count.execute()
            return True
        except:
            return False
664664
public void delete(long oid) throws SQLException {
    FastpathArg[] args = new FastpathArg[1];
    args[0] = Fastpath.createOIDArg(oid);
    fp.fastpath("lo_unlink", args);
  }
383765
public int deleteAll() throws SQLException {

		int count = 0;

		if (isTableExists()) {
			DeleteBuilder<GeometryIndex, GeometryIndexKey> db = deleteBuilder();
			PreparedDelete<GeometryIndex> deleteQuery = db.prepare();
			count = delete(deleteQuery);
		}

		return count;
	}
607966
public void deleteRedirect(int id) {
        try {
            sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS +
                                         " WHERE " + Constants.GENERIC_ID + " = " + id + ";");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
463444
public int deleteByTableName(String tableName) throws SQLException {
		DeleteBuilder<MetadataReference, Void> db = deleteBuilder();
		db.where().eq(MetadataReference.COLUMN_TABLE_NAME, tableName);
		PreparedDelete<MetadataReference> deleteQuery = db.prepare();
		int deleted = delete(deleteQuery);
		return deleted;
	}
484667
public function deleteUserQuery($userId)
    {
        $qb = $this->createQueryBuilder();
        $qb->delete($this->getTableName());

        if (is_numeric($userId)) {
            $qb->where('id = :userId');
        } else {
            $qb->where('username = :userId')->orWhere('email = :userId');
        }
        $qb->setParameter('userId', $userId);

        return $qb;
    }