Move presences from 'entity' from one presence map to another.

@param entity the entity
@param from the map to move presences from
@param to the map to move presences to
969215
private static void move(BareJid entity, Map<BareJid, Map<Resourcepart, Presence>> from, Map<BareJid, Map<Resourcepart, Presence>> to) {
        Map<Resourcepart, Presence> presences = from.remove(entity);
        if (presences != null && !presences.isEmpty()) {
            to.put(entity, presences);
        }
    }
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);
	}
594281
@Override
    public T update(T entity) {
        EntityManager entityManager = getEntityManager();
        T result = entityManager.merge(entity);
        return result;
    }
1140701
@Override
    public void detach(Object entity) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.detach(" + entity + ");\n" + toString());

        getEMInvocationInfo(false).detach(entity);
    }
985883
@Override
	public void put(Object entity) {
		ResourceManager<Transaction> manager = new AppEngineResourceManager(
				datastore, datastore.beginTransaction(), transaction);
		manager.put(entity);
		Log log = new Log(transaction.logs().size() + 1, Log.Operation.PUT, entity);
		log.state(State.UNCOMMITTED);
		transaction.logs().add(log);
		managers.put(keyValue(entity), manager);
		logger.fine("Transaction [" + transaction.id() + "]: Entity [" + entity + "] has been put");
	}
1291621
public <T> void delete(T entity) {
		if (entity == null) {
			throw new ApitraryOrmException("Cannot delete null entity");
		}

		log.debug("Deleting " + entity.getClass());

		DeleteRequest request = new DeleteRequest();
		request.setEntity(resolveApitraryEntity(entity));
		String id = resolveApitraryEntityId(entity);
		request.setId(id);

		new CascadeDeleteCapable(this).deleteCascades(entity);

		DeleteResponse response = resolveApitraryClient().send(request);
		if (HttpStatus.OK.ordinal() != response.getStatusCode()) {
			if (HttpStatus.Not_Found.ordinal() == response.getStatusCode()) {
				throw new ApitraryOrmDeleteException("Object with id " + id + " does not exist.");
			} else {
				String statusMessage = (String) new DeleteResponseUnmarshaller().unMarshall(response, entity);
				throw new ApitraryOrmDeleteException(statusMessage);
			}
		}
	}
1059893
@Override
	public void init(EntityManager entityManager, Object entity) {
		
		// Initialisation des parametres
		this.entityManager = entityManager;
		this.entity = entity;
	}
71804
void movePageContents(final int from, final int to) {
        final PageModel<T> fromModel = mPageModels[from];
        final PageModel<T> toModel = mPageModels[to];
        if (fromModel == null || toModel == null) {
            Log.w(Constants.LOG_TAG, "fillPage no model found " + fromModel + " " + toModel);
            return;
        }
        if (Constants.DEBUG) {
            Log.d("InfiniteViewPager",
                String.format("Moving page %s to %s, indicator from %s to %s", from, to,
                fromModel.getIndicator(), toModel.getIndicator()));
            printPageModels("before");
        }


        toModel.removeAllChildren();
        for (View view : fromModel.getChildren()) {
            fromModel.removeViewFromParent(view);
            toModel.addChild(view);
        }

        if (Constants.DEBUG) {
            printPageModels("transfer");
        }
        mPageModels[to].setIndicator(fromModel.getIndicator());
        if (Constants.DEBUG) {
            printPageModels("after");
        }
    }
800544
public void put(Entity entity) {
    EntityType entityType = entity.getEntityType();
    cache.put(
        EntityKey.create(entityType, entity.getIdValue()),
        CacheHit.of(entityHydration.dehydrate(entity)));
  }
1168636
public void populate(Entity entity) {
    // auto date
    generateAutoDateOrDateTime(singletonList(entity), entity.getEntityType().getAttributes());

    // auto id
    Attribute idAttr = entity.getEntityType().getIdAttribute();
    if (idAttr != null
        && idAttr.isAuto()
        && entity.getIdValue() == null
        && (idAttr.getDataType() == STRING)) {
      entity.set(idAttr.getName(), idGenerator.generateId());
    }
  }
493067
public void put(Entity entity) {
    int bytesHere = EntityTranslator.convertToPb(entity).getSerializedSize();

    // Do this before the add so that we guarantee that size is never > sizeLimit
    if (putsBytes + bytesHere >= params.getBytesLimit()) {
      flushPuts();
    }

    putsBytes += bytesHere;
    puts.add(entity);

    if (puts.size() >= params.getCountLimit()) {
      flushPuts();
    }
  }
108045
public void add(Object entity, String name) {
		Result result = new Result(entity, name);
		results.add(result);
	}
782166
@Override
    public <T> T merge(T entity)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.merge(" + entity + ");\n" + toString());

        return getEMInvocationInfo(true).merge(entity);
    }
650790
protected <E extends Identifiable> void deleteEntity(EntityManager em, E entity) {
		requireArgument(em != null, "The entity manager cannot be null.");
		requireArgument(entity != null, "The entity cannot be null.");
		if (!em.contains(entity)) {
			Identifiable attached = findEntity(em, entity.getId(), entity.getClass());
			em.remove(attached);
		} else {
			em.remove(entity);
		}
	}
928754
private void setRelationToEntity(Object entity, Object relationEntity, Relation relation)
    {
        if (relation.getTargetEntity().isAssignableFrom(getEntity(relationEntity).getClass()))
        {

            if (relation.isUnary())
            {
                PropertyAccessorHelper.set(entity, relation.getProperty(), getEntity(relationEntity));
            }
            else
            {
                Object associationObject = PropertyAccessorHelper.getObject(entity, relation.getProperty());
                if (associationObject == null || ProxyHelper.isProxyOrCollection(associationObject))
                {
                    associationObject = PropertyAccessorHelper.getCollectionInstance(relation.getProperty());
                    PropertyAccessorHelper.set(entity, relation.getProperty(), associationObject);
                }

                ((Collection) associationObject).add(getEntity(relationEntity));
            }
        }
    }
859078
public void addCurrentEntity(Object entity) {
        Object identifier = identifier(entity);
        Object o = memento.get(identifier);
        if (o == null) {
            inserted.add(entity);
        } else {
            potentiallyChanged.put(identifier, entity);
        }
    }
9009
public void updateMappedByEntities(
      @Nonnull Entity entity, @Nullable @CheckForNull Entity existingEntity) {
    entity
        .getEntityType()
        .getMappedByAttributes()
        .forEach(
            mappedByAttr -> {
              AttributeType type = mappedByAttr.getDataType();
              if (type != ONE_TO_MANY) {
                throw new RuntimeException(
                    format(
                        "Attribute [%s] of type [%s] can't be mapped by another attribute",
                        mappedByAttr.getName(), type.toString()));
              }
              updateMappedByEntitiesOneToMany(entity, existingEntity, mappedByAttr);
            });
  }