Deletes the given entity instances. The instances are removed from the persistent layer.

@param entities the entities to remove from the persistent layer
@return the set of entity instances
488384
@Override
    public Iterable<T> delete(final Iterable<T> entities) {
        return inTransaction(new Callable<Iterable<T>>() {
            @Override
            public Iterable<T> call() throws Exception {
                for (T object : entities) {
                    T attached = getAttached(object);
                    if (attached != null) {
                        entityManager.remove(attached);
                    }
                }
                return entities;
            }
        });
    }
775115
public DeleteRequestBuilder<T,ID> delete(ID... ids)
    {
        return new DeleteRequestBuilder<T, ID>(version,type,entityName,ids);
    }
276319
public <T> void evict(T entity) {
        DocumentInfo documentInfo = documentsByEntity.get(entity);
        if (documentInfo != null) {
            documentsByEntity.remove(entity);
            documentsById.remove(documentInfo.getId());
        }

        deletedEntities.remove(entity);
        if (_countersByDocId != null) {
            _countersByDocId.remove(documentInfo.getId());
        }
    }
144108
public function remove(Entity $entity) {
    if (method_exists($entity,'remove')) {
      $entity->remove();
    }
    $this->_em->remove($entity);
    
    return $this;
  }
113387
@Override
	public void setDeleteParams(final SqlContext context, final Object entity) {
		setFields(context, entity, SqlKind.DELETE, MappingColumn::getCamelName);
	}
514896
public void deleteCascades(Object entity) {
		if (entity != null) {
			List<Field> fields = ClassUtil.getAnnotatedFields(entity.getClass(), Reference.class);
			for (Field field : fields) {
				Cascade[] cascades = ClassUtil.getFieldAnnotationValue("cascade", field, Reference.class, Cascade[].class);
				if (Arrays.asList(cascades).contains(Cascade.DELETE)) {
					Object referencedEntity = ClassUtil.getValueOfField(field, entity);
					if(referencedEntity != null){
						try {
							apitraryDaoSupport.resolveApitraryEntityId(referencedEntity);
							apitraryDaoSupport.delete(referencedEntity);
						} catch (ApitraryOrmIdException aoie) {
							/*
							 * TODO find better way for exception without breaking th cascade flow
							 */
							log.warn(aoie);
						}
					}
				}
			}
		}
	}
152981
private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
        final PersistentEntityId id = entity.getId();
        final int entityTypeId = id.getTypeId();
        final long entityLocalId = id.getLocalId();
        final Transaction envTxn = txn.getEnvironmentTransaction();
        final LinksTable links = getLinksTable(txn, entityTypeId);
        final IntHashSet deletedLinks = new IntHashSet();
        try (Cursor cursor = links.getFirstIndexCursor(envTxn)) {
            for (boolean success = cursor.getSearchKeyRange(PropertyKey.propertyKeyToEntry(new PropertyKey(entityLocalId, 0))) != null;
                 success; success = cursor.getNext()) {
                final ByteIterable keyEntry = cursor.getKey();
                final PropertyKey key = PropertyKey.entryToPropertyKey(keyEntry);
                if (key.getEntityLocalId() != entityLocalId) {
                    break;
                }
                final ByteIterable valueEntry = cursor.getValue();
                if (links.delete(envTxn, keyEntry, valueEntry)) {
                    int linkId = key.getPropertyId();
                    if (getLinkName(txn, linkId) != null) {
                        deletedLinks.add(linkId);
                        final LinkValue linkValue = LinkValue.entryToLinkValue(valueEntry);
                        txn.linkDeleted(entity.getId(), (PersistentEntityId) linkValue.getEntityId(), linkValue.getLinkId());
                    }
                }
            }
        }
        for (Integer linkId : deletedLinks) {
            links.deleteAllIndex(envTxn, linkId, entityLocalId);
        }
    }
278725
boolean deleteEntity(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
        clearProperties(txn, entity);
        clearBlobs(txn, entity);
        deleteLinks(txn, entity);
        final PersistentEntityId id = entity.getId();
        final int entityTypeId = id.getTypeId();
        final long entityLocalId = id.getLocalId();
        final ByteIterable key = LongBinding.longToCompressedEntry(entityLocalId);
        if (config.isDebugSearchForIncomingLinksOnDelete()) {
            // search for incoming links
            final List<String> allLinkNames = getAllLinkNames(txn);
            for (final String entityType : txn.getEntityTypes()) {
                for (final String linkName : allLinkNames) {
                    //noinspection LoopStatementThatDoesntLoop
                    for (final Entity referrer : txn.findLinks(entityType, entity, linkName)) {
                        throw new EntityStoreException(entity +
                            " is about to be deleted, but it is referenced by " + referrer + ", link name: " + linkName);
                    }
                }
            }
        }
        if (getEntitiesTable(txn, entityTypeId).delete(txn.getEnvironmentTransaction(), key)) {
            txn.entityDeleted(id);
            return true;
        }
        return false;
    }
856409
public function delete(Entity $entity) {
    $this->remove($entity);
    $this->_em->flush();
    
    return $this;
  }
1224155
public boolean deleteEntityGroup(EntityGroup entityGroup) {
        String entityGroupName = entityGroup.getName();
        checkEntityGroupIsEmpty(entityGroupName);
        QueryPart<EntityGroup> query = new Query<EntityGroup>("entity-groups")
                .path(entityGroupName, true);
        return httpClientManager.updateMetaData(query, delete());
    }
943330
@Override
  public <T> List<T> remove(Collection<? extends T> batchToRemove, Class<T> entityClass) {
    return remove(batchToRemove, Util.determineCollectionName(entityClass));
  }
209322
def remove_entities(self, entity_ids):
        
        if len(entity_ids) == 0:
            return
        keep = np.ones(len(self.entities))
        keep[entity_ids] = False
        self.entities = self.entities[keep]
1189515
def unset(entity, *types):
    
    if not types:
        types = (TypedField,)

    fields = list(entity._fields.keys())
    remove = (x for x in fields if isinstance(x, types))

    for field in remove:
        del entity._fields[field]
93364
def delete(self, entity):
    
    key = _normalize_key(entity)
    if key is None:
      return self.ndb_delete(entity)
    self.deletes.append(key)
363814
public void setEntityValues(java.util.Collection<String> entityValues) {
        if (entityValues == null) {
            this.entityValues = null;
            return;
        }

        this.entityValues = new java.util.ArrayList<String>(entityValues);
    }
315744
public void setEntities(java.util.Collection<InventoryResultEntity> entities) {
        if (entities == null) {
            this.entities = null;
            return;
        }

        this.entities = new com.amazonaws.internal.SdkInternalList<InventoryResultEntity>(entities);
    }
648593
@Override
    public void delete(Object entity, Object key)
    {
        // All Modifying Neo4J operations must be executed within a transaction
        checkActiveTransaction();

        GraphDatabaseService graphDb = getConnection();

        // Find Node for this particular entity
        EntityMetadata m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());
        Node node = mapper.searchNode(key, m, graphDb, true);
        if (node != null)
        {
            // Remove this particular node, if not already deleted in current
            // transaction
            if (!((Neo4JTransaction) resource).containsNodeId(node.getId()))
            {
                node.delete();

                // Manually remove node index if applicable
                indexer.deleteNodeIndex(m, graphDb, node);

                // Remove all relationship edges attached to this node
                // (otherwise an
                // exception is thrown)
                for (Relationship relationship : node.getRelationships())
                {
                    relationship.delete();

                    // Manually remove relationship index if applicable
                    indexer.deleteRelationshipIndex(m, graphDb, relationship);
                }

                ((Neo4JTransaction) resource).addNodeId(node.getId());
            }
        }
        else
        {
            if (log.isDebugEnabled())
                log.debug("Entity to be deleted doesn't exist in graph. Doing nothing");
        }
    }