Add entity id to model.
17867
public function getEntityIdAttribute()
    {
        if ($this->attributes['data'] == '' || $this->attributes['type'] != 'entity')
            return null;

        $data = unserialize($this->attributes['data']);

        if (!isset($data['entity_type']))
            return null;
        else {
            $entity_type = explode(':', $data['entity_type']);

            return isset($entity_type[1]) ? $entity_type[1] : null;
        }
    }
1005722
protected function setId()
    {
        $this->id = $this->source->id;
        if ($this->getType() === Source::CreditNote) {
            $this->addProperties();
        }
    }
885723
def add_data(self, request, pk=None):
        """"""
        collection = self.get_object()

        if 'ids' not in request.data:
            return Response({"error": "`ids`parameter is required"}, status=status.HTTP_400_BAD_REQUEST)

        missing = []
        for data_id in request.data['ids']:
            if not Data.objects.filter(pk=data_id).exists():
                missing.append(data_id)

        if missing:
            return Response(
                {"error": "Data objects with following ids are missing: {}".format(', '.join(missing))},
                status=status.HTTP_400_BAD_REQUEST)

        for data_id in request.data['ids']:
            collection.data.add(data_id)

        return Response()
432686
def _create_id_field(new_class):
        """"""
        id_field = Auto(identifier=True)

        setattr(new_class, 'id', id_field)
        id_field.__set_name__(new_class, 'id')

        # Ensure ID field is updated properly in Meta attribute
        new_class.meta_.declared_fields['id'] = id_field
        new_class.meta_.id_field = id_field
574347
def _populate(self):
        """"""
        self.add(self._core_data)
        if self.initial_data:
            self.add(self.initial_data)
49441
def add_entity(self, property_name, use_context=True):
        
        if self.has_property(property_name):
            err = 'Property "{}" already exists'
            raise PropertyExists(err.format(property_name))
        prop = EntityProperty(use_context=bool(use_context))
        self.entities[property_name] = prop
        return prop
11114
def add_oid(self,oid,value,label=None):
		""""""
		self.add_oid_entry(oid,'OBJECTID',value,label=label)
1077627
def make_id(self):
        """"""
        if self.url_id is None:  # Set id only if empty
            self.url_id = select([func.coalesce(func.max(self.__class__.url_id + 1), 1)],
                self.__class__.parent == self.parent)
1019049
def add_int(self,oid,value,label=None):
		""""""
		self.add_oid_entry(oid,'INTEGER',value,label=label)
865317
public void saveOrUpdate(E e) {
        final Integer id = e.getId();
        final boolean hasId = id != null;
        String createOrUpdatePrefix = hasId ? "Updating" : "Creating a new";
        String idSuffix = hasId ? " with ID " + id : "";

        LOG.trace(createOrUpdatePrefix + " instance of " + entityClass.getSimpleName()
            + idSuffix);

        e.setModified(DateTime.now());
        getSession().saveOrUpdate(e);
    }
632465
public function registerEntity(Entity $entity)
    {
        Logger::get()->debug('Registering entity ' . get_class($entity) . ":{$entity->id}...");
        self::$entities[get_called_class()][$entity->id] = $entity;
        Logger::get()->debug('Registered.');
    }
223073
public void addEntity(String alias, Class<?> entityClass) {
    EntityType entityType = Model.getType(entityClass);
    if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityClass); }
    entityTypes.put(alias, entityType);
  }
608975
function _addEntityIdentifier(entity, obj) {
    if (entity.constructor === EVT.Entity.Product) {
      obj.product = entity.id;
    } else if (entity.constructor === EVT.Entity.Thng) {
      obj.thng = entity.id;
    } else if (entity.constructor === EVT.Entity.Collection) {
      obj.collection = entity.id;
    }

    return obj;
  }
295880
public void setEntityId(String v) {
    if (DictTerm_Type.featOkTst && ((DictTerm_Type)jcasType).casFeat_entityId == null)
      jcasType.jcas.throwFeatMissing("entityId", "ch.epfl.bbp.uima.types.DictTerm");
    jcasType.ll_cas.ll_setStringValue(addr, ((DictTerm_Type)jcasType).casFeatCode_entityId, v);}
331789
def add_instance(model, _commit=True, **kwargs):
    
    try:
        model = get_model(model)
    except ImportError:
        return None

    instance = model(**kwargs)
    db.session.add(instance)

    try:
        if _commit:
            db.session.commit()
        else:
            db.session.flush()
        return instance.id
    except IntegrityError:
        db.session.rollback()
        return
392757
def register_id(self, id, module):
        """"""
        assert isinstance(id, basestring)
        assert isinstance(module, basestring)
        self.id2module[id] = module
58306
def add(self, entity):
        
        characteristic = self.extract_traits(entity)
        if not characteristic.traits:
            return

        if characteristic.is_matching:
            self.add_match(entity, *characteristic.traits)
        else:
            self.add_mismatch(entity, *characteristic.traits)