Stores the specified entity in the session, explicitly specifying its Id. The entity will be saved when SaveChanges is called.

@param entity       Entity to store
@param changeVector Change vector
@param id           Entity identifier
512238
public void store(Object entity, String changeVector, String id) {
        storeInternal(entity, changeVector, id, changeVector == null ? ConcurrencyCheckMode.DISABLED : ConcurrencyCheckMode.FORCED);
    }
881454
public void addEntityId(long entityId)
    {
        if(this.entityIds == null)
            this.entityIds = new ArrayList<Long>();
        this.entityIds.add(entityId);
    }
677933
public boolean hasChanged(Object entity) {
        DocumentInfo documentInfo = documentsByEntity.get(entity);

        if (documentInfo == null) {
            return false;
        }

        ObjectNode document = entityToJson.convertEntityToJson(entity, documentInfo);
        return entityChanged(document, documentInfo, null);
    }
1072653
private void populateId(EntityMetadata entityMetadata, Table schemaTable, Object entity, Row row)
    {
        FieldDef fieldMetadata;
        FieldValue value;
        String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();

        fieldMetadata = schemaTable.getField(idColumnName);

        value = row.get(idColumnName);

        NoSqlDBUtils.get(fieldMetadata, value, entity, (Field) entityMetadata.getIdAttribute().getJavaMember());
    }
875030
private void changeEntityValue(String value, int valueIndex) {

        if (getEntityType().isChoice()) {
            CmsEntity choice = m_entity.getAttribute(CmsType.CHOICE_ATTRIBUTE_NAME).getComplexValues().get(valueIndex);
            String attributeName = getChoiceName(valueIndex);
            if (attributeName != null) {
                choice.setAttributeValue(attributeName, value, 0);
            }
        } else {
            m_entity.setAttributeValue(m_attributeName, value, valueIndex);
        }
    }
335141
public function savePropertyId($propertyId, $id = false)
    {
        $em = $this->getEntityManager();
        $config = $id ? $this->find($id) : $this->findFirst();
        $config->setPropertyId($propertyId);
        $em->persist($config);
        $em->flush();
    }
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();
    }
  }
1064307
@Override
  public void add(Entity entity) {
    if (entity == null) throw new IllegalArgumentException("Entity cannot be null");
    if (cachedAttributes == null)
      throw new MolgenisDataException(
          "The attribute names are not defined, call writeAttributeNames first");

    int i = 0;
    Row poiRow = sheet.createRow(row++);
    for (Attribute attribute : cachedAttributes) {
      Cell cell = poiRow.createCell(i++, CellType.STRING);
      cell.setCellValue(toValue(entity.get(attribute.getName())));
    }

    entity.getIdValue();
  }
197356
public void persist(Object e)
    {
        if (e == null)
        {
            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        // Create an object graph of the entity object.
        ObjectGraph graph = new GraphGenerator().generateGraph(e, this);
        // Call persist on each node in object graph.
        Node node = graph.getHeadNode();
        try
        {
            // Get write lock before writing object required for transaction.
            lock.writeLock().lock();

            node.setPersistenceDelegator(this);
            node.persist();

            // build flush stack.
            flushManager.buildFlushStack(node, com.impetus.kundera.persistence.context.EventLog.EventType.INSERT);

            // Flushing data.
            flush();

            // Add node to persistence context after successful flush.
            getPersistenceCache().getMainCache().addHeadNode(node);
        }
        finally
        {
            lock.writeLock().unlock();
        }

        // Unlocking object.
        graph.clear();
        graph = null;
        if (log.isDebugEnabled())
        {
            log.debug("Data persisted successfully for entity {}.", e.getClass());
        }
    }
996513
public void addEntity(Entity entity){
		boolean delayed = updating || familyManager.notifying();
		entityManager.addEntity(entity, delayed);
	}
157215
public void saveEntities(Set<String> entityIds, boolean clearOnSuccess, Command callback) {

        List<CmsEntity> entities = new ArrayList<CmsEntity>();
        for (String entityId : entityIds) {
            CmsEntity entity = m_entityBackend.getEntity(entityId);
            if (entity != null) {
                entities.add(entity);
            }
        }
        saveEntities(entities, clearOnSuccess, callback);
    }
139192
public void setId(String id) {
      if (StringUtils.isNullOrBlank(id)) {
         this.id = UUID.randomUUID().toString();
      } else {
         this.id = id;
      }
   }
1223917
public void putEntity(Entity entity) {
        Assert.isTrue(entity.hasTableName(), "Expecting a table name for the entity: " + entity.getName());
        Assert.isTrue(!hasEntityBySchemaAndTableName(entity.getTable().getSchemaName(), entity.getTable().getName()), "Entity was already added!: " + entity.getTableName());
        currentEntitiesByTableName.put(entity.getTable().getName().toUpperCase(), entity);
        currentEntitiesBySchemaAndTableName.put(entity.getTable().asKeyForMap(), entity);
    }
1027613
public void setAttribute(String id, Object obj, boolean save) {
        if (save) {
            String historyAttribute = id + "history";
            Queue<Object> history = (Queue<Object>) getAttribute(historyAttribute);
            if (history == null) {
                history = new LinkedList<>();
                setAttribute(historyAttribute, history);
            }
            if (this.getAttribute(id) != null) {
                history.add(getAttribute(id));
            }
        }
        setAttribute(id, obj);
    }
907489
@Override
    public void persist(Object entity)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.persist(" + entity + ");\n" + toString());

        getEMInvocationInfo(true).persist(entity);
    }
138056
private void selectEntity(Entity entity, Item<Entity> item, String sectionId) {
    	SectionContext sectionContext = NextServerSession.get().getSectionContext(sectionId);
    	if (sectionContext == null) {
    		return;
    	}

        String entityPath = SectionContextUtil.getSelectedEntityPath(sectionId);
        if ((entityPath != null) && entity.getPath().equals(entityPath)) {
            item.add(AttributeModifier.replace("class", "tr-selected"));
            // reset
            SectionContextUtil.setSelectedEntityPath(sectionId, null);
        }
    }
70403
public void insertAttributeValue(String attributeName, CmsEntity value, int index) {

        if (m_entityAttributes.containsKey(attributeName)) {
            m_entityAttributes.get(attributeName).add(index, value);
        } else {
            setAttributeValue(attributeName, value);
        }
        registerChangeHandler(value);
        fireChange();
    }