Deletes all entities for the given entity name but tunnels DELETE through POST
169904
@PostMapping(value = "/{entityTypeId}", params = "_method=DELETE")
  @ResponseStatus(NO_CONTENT)
  public void deleteAllPost(@PathVariable("entityTypeId") String entityTypeId) {
    dataService.deleteAll(entityTypeId);
  }
828301
@Override
	public void delete(Object entity) {
		if (entity == null) {
			throw new IllegalArgumentException("'entity' must not be [" + entity + "]");
		}
		
		assertTransactional();
		List<Log> logs = transaction.get().logs();
		
		if (logs.isEmpty()) {
			throw new IllegalStateException("Log ["
					+ Log.Operation.DELETE
					+ "] is not allowed: previous operation must be ["
					+ Log.Operation.GET + "]");
		}
		
		for (int i = logs.size() - 1; i >= 0; i--) {
			Log log = logs.get(i);
			
			if (keyValue(entity).equals(keyValue(log.entity()))) {
				if (log.operation() == Log.Operation.GET) {
					break;
				} else {
					throw new IllegalStateException("Log [" + log.operation() 
							+ "] -> [" + Log.Operation.DELETE
							+ "] is not allowed: previous operation must be ["
							+ Log.Operation.GET + "]");
				}
			}
		}
		
		Transaction tx = transaction.get().transaction();
		List<Key> keys = new ArrayList<Key>();
		
		for (Entity e : Translation.toEntities(entity)) {
			keys.add(e.getKey());
		}
		
		datastore.delete(tx, keys);
		Log log = new Log(logs.size() + 1, Log.Operation.DELETE, entity);
		log.state(State.UNCOMMITTED);
		logs.add(log);
	}
905192
@Override
    public void delete(Object entity, Object pKey)
    {
        if (entity != null)
        {
            EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());

            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                    .getMetamodel(metadata.getPersistenceUnit());

            EntityType entityType = metaModel.entity(metadata.getEntityClazz());

            String keyAsString = getKeyAsString(pKey, metadata, metaModel);

            try
            {
                txClient.prepareDelete(metadata.getSchema().toLowerCase(), metadata.getTableName(),
                        keyAsString.toString()/* index, type, id */).setRefresh(isRefreshIndexes()).execute().get();
            }
            catch (InterruptedException iex)
            {
                logger.error("Error while deleting record of {}, Caused by :.", pKey, iex);
                throw new PersistenceException(iex);
            }
            catch (ExecutionException eex)
            {
                logger.error("Error while deleting record of {}, Caused by :.", pKey, eex);
                throw new PersistenceException(eex);
            }
        }

    }
1093424
def delete(self, eid):
		
		result = self._http_req('connections/%u' % eid, method='DELETE')
		status = result['status']
		if not status == 302:
			raise ServiceRegistryError(status, "Could not delete entity %u: %u" % (eid,status))

		self.debug(0x01,result)
		return result['decoded']
367887
@Override
	public void delete(final T entity) {
		String id = null;
		try {
			id = (String) arangoOperations.getConverter().getMappingContext().getPersistentEntity(domainClass)
					.getIdProperty().getField().get(entity);
		} catch (final IllegalAccessException e) {
			e.printStackTrace();
		}
		arangoOperations.delete(id, domainClass);
	}
1046713
@Override
    protected void delete(Object entity, Object pKey)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                .getMetamodel(entityMetadata.getPersistenceUnit());
        EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz());

        KuduSession session = kuduClient.newSession();
        KuduTable table = null;
        try
        {
            table = kuduClient.openTable(entityMetadata.getTableName());
        }
        catch (Exception e)
        {
            logger.error("Cannot open table : " + entityMetadata.getTableName(), e);
            throw new KunderaException("Cannot open table : " + entityMetadata.getTableName(), e);
        }
        Delete delete = table.newDelete();
        PartialRow row = delete.getRow();
        String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getName();

        Field field = (Field) entityType.getAttribute(idColumnName).getJavaMember();
        Object value = PropertyAccessorHelper.getObject(entity, field);
        Type idType = KuduDBValidationClassMapper.getValidTypeForClass(field.getType());

        if (entityType.getAttribute(idColumnName).getJavaType().isAnnotationPresent(Embeddable.class))
        {
            // Composite Id
            EmbeddableType embeddableIdType = metaModel.embeddable(entityType.getAttribute(idColumnName).getJavaType());
            Field[] fields = entityType.getAttribute(idColumnName).getJavaType().getDeclaredFields();
            addPrimaryKeyToRow(row, embeddableIdType, fields, metaModel, value);
        }
        else
        {
            // Simple Id
            KuduDBDataHandler.addToRow(row, ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName(),
                    value, idType);
        }

        try
        {
            session.apply(delete);
        }
        catch (Exception e)
        {
            logger.error("Cannot delete row from table : " + entityMetadata.getTableName(), e);
            throw new KunderaException("Cannot delete row from table : " + entityMetadata.getTableName(), e);
        }
        finally
        {
            try
            {
                session.close();
            }
            catch (Exception e)
            {
                logger.error("Cannot close session", e);
                throw new KunderaException("Cannot close session", e);
            }
        }
    }
634834
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
    public ResponseEntity<E> delete(@PathVariable int id) {

        try {
            E entityToDelete = this.service.findById(id);

            this.service.delete(entityToDelete);

            // extract the original classname from the name of the proxy, which
            // also contains _$$_ and some kind of hash after the original
            // classname
            final String proxyClassName = entityToDelete.getClass().getSimpleName();
            final String simpleClassName = StringUtils.substringBefore(proxyClassName, "_$$_");

            LOG.trace("Deleted " + simpleClassName + " with ID " + id);
            return new ResponseEntity<E>(HttpStatus.NO_CONTENT);
        } catch (Exception e) {
            LOG.error("Error deleting entity with ID " + id + ": "
                + e.getMessage());
            return new ResponseEntity<E>(HttpStatus.NOT_FOUND);
        }
    }
1030737
@Override
    public void clear() {
        EntityManager em = getEntityManager();
        Object newTx = joinTransaction(em);
        try {
            	        
	        int deletedNodes = em.createQuery("delete FROM NodeInstanceLog WHERE processInstanceId in (select spl.processInstanceId FROM ProcessInstanceLog spl WHERE spl.status in (2, 3))").executeUpdate();
	        logger.debug("CLEAR:: deleted node instances {}", deletedNodes);
	        
	        int deletedVariables = em.createQuery("delete FROM VariableInstanceLog WHERE processInstanceId in (select spl.processInstanceId FROM ProcessInstanceLog spl WHERE spl.status in (2, 3))").executeUpdate();
	        logger.debug("CLEAR:: deleted variable instances {}", deletedVariables);
	        
	        int deletedProcesses = em.createQuery("delete FROM ProcessInstanceLog WHERE status in (2, 3)").executeUpdate();
            logger.debug("CLEAR:: deleted process instances {}", deletedProcesses);
        } finally {
        	closeEntityManager(em, newTx);
        }
    }
731638
@SuppressWarnings("unchecked")
	@Override
	public <E> int delete(final Class<? extends E> entityType, final Object... keys) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isAssignableFrom(entityType)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);
			TableMetadata.Column keyColumn = null;
			List<? extends TableMetadata.Column> keyColumns = metadata.getKeyColumns();
			if (keyColumns.size() == 1) {
				keyColumn = keyColumns.get(0);
			} else if (keyColumns.isEmpty()) {
				keyColumn = metadata.getColumns().get(0);
			} else {
				throw new IllegalArgumentException("Entity has multiple keys");
			}
			return delete(entityType).in(keyColumn.getCamelColumnName(), keys).count();
		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.DELETE, e);
		}
	}
1097647
@Override
    public String delete(EntityDeleteOperation deleter) throws ServiceException {
        deleter.setProxyData(createProxyData());
        ClientResponse clientResponse =  getResource(deleter.getUri()).delete(ClientResponse.class);
        PipelineHelpers.throwIfNotSuccess(clientResponse);
        if (clientResponse.getHeaders().containsKey("operation-id")) {
            List<String> operationIds = clientResponse.getHeaders().get("operation-id");
            if (operationIds.size() >= 0) {
                return operationIds.get(0);
            }
        }
        return null;
    }
270992
public function deleteAction() {
        try {
            if(sizeOf($this->dispatcher->getParams()) == 0) {
                throw new Exception('Invalid Entity Id Passed In', 400);
            }
            $entity = $this->validateEntityId($this->dispatcher->getParam(0));
            $this->deleteActionInternal($entity);
        } catch(Exception $e) {
            $this->handleError($e);
        } catch(ValidationException $e) {
            $this->handleValidationError($e);
        } catch(AclException $e) {
            $this->handleAclError($e);
        }
    }
958138
@Override
	public synchronized void deleteAllDataForContext(int contextId) throws DatabaseException {
    	SqlPreparedStatementWrapper psDeleteAllDataForContext = null;
    	try {
        	psDeleteAllDataForContext = DbSQL.getSingleton().getPreparedStatement("context.ps.deletealldataforcontext");
			psDeleteAllDataForContext.getPs().setInt(1, contextId);
			psDeleteAllDataForContext.getPs().executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psDeleteAllDataForContext);
		}
    }
239572
private static String initRemoveEntityQuery(EntityKeyMetadata entityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder( "MATCH " );
		appendEntityNode( "n", entityKeyMetadata, queryBuilder );
		queryBuilder.append( " OPTIONAL MATCH (n)-[r]->(e:EMBEDDED), path=(e)-[*0..]->(:EMBEDDED) " );
		queryBuilder.append( " DELETE r " );
		queryBuilder.append( " FOREACH (er IN relationships(path) | DELETE er) " );
		queryBuilder.append( " FOREACH (en IN nodes(path) | DELETE en) " );
		queryBuilder.append( " WITH n " );
		queryBuilder.append( " OPTIONAL MATCH (n)-[r]-() " );
		queryBuilder.append( " DELETE r,n " );
		return queryBuilder.toString();
	}
742627
function (state, payload) {
        var entity = payload.entity;
        var where = payload.where;
        var result = payload.result;
        result.data = (new Query(state, entity)).delete(where);
    }
202083
@Override
    public String delete(EntityDeleteOperation deleter) throws ServiceException {
        try {
            return service.delete(deleter);
        } catch (UniformInterfaceException e) {
            throw processCatch(new ServiceException(e));
        } catch (ClientHandlerException e) {
            throw processCatch(new ServiceException(e));
        }
    }
746288
def delete_post(self, post_id):
        
        status = False
        success = 0
        post_id = _as_int(post_id)
        with self._engine.begin() as conn:
            try:
                post_del_statement = self._post_table.delete().where(
                    self._post_table.c.id == post_id)
                conn.execute(post_del_statement)
                success += 1
            except Exception as e:
                self._logger.exception(str(e))
            try:
                user_posts_del_statement = self._user_posts_table.delete(). \
                    where(self._user_posts_table.c.post_id == post_id)
                conn.execute(user_posts_del_statement)
                success += 1
            except Exception as e:
                self._logger.exception(str(e))
            try:
                tag_posts_del_statement = self._tag_posts_table.delete(). \
                    where(self._tag_posts_table.c.post_id == post_id)
                conn.execute(tag_posts_del_statement)
                success += 1
            except Exception as e:
                self._logger.exception(str(e))
        status = success == 3
        return status
272947
public <T> void delete(T entity) {
        if (entity == null) {
            throw new IllegalArgumentException("Entity cannot be null");
        }

        DocumentInfo value = documentsByEntity.get(entity);
        if (value == null) {
            throw new IllegalStateException(entity + " is not associated with the session, cannot delete unknown entity instance");
        }

        deletedEntities.add(entity);
        includedDocumentsById.remove(value.getId());
        if (_countersByDocId != null) {
            _countersByDocId.remove(value.getId());
        }
        _knownMissingIds.add(value.getId());
    }