records.add(newEntity()); // CHANGE #7b
340330
private void revertInsertRow(long id, int row, boolean reuseRow) {
		// INFORM INSIDER
		insider.uninserting(clazz, id);

		idColl.cancelId(id); // UNDO CHANGE #1

		if (reuseRow) {
			deleted.add(row); // UNDO CHANGE #2
		} else {
			rows--; // UNDO CHANGE #3
		}

		idColl.delete(id); // UNDO CHANGE #4

		size--; // UNDO CHANGE #5

		ids.remove(id); // UNDO CHANGE #6

		if (reuseRow) {
			// NO NEED TO UNDO CHANGE #7a
		} else {
			records.remove(records.size() - 1); // UNDO CHANGE #7b
		}
	}
10571
public Entity newEntity(QualifiedName id, String label) {
	Entity res = newEntity(id);
	if (label != null)
	    res.getLabel().add(newInternationalizedString(label));
	return res;
    }
120347
function ChangeRecord(object, type, name, oldValue) {
    this.object = object;
    this.type = type;
    this.name = name;
    this.oldValue = oldValue;
  }
555808
public int insertOrUpdate(Connection conn, Entity record, String... keys) throws SQLException {
		final Entity where = record.filter(keys);
		if(MapUtil.isNotEmpty(where) && count(conn, where) > 0) {
			return update(conn, record, where);
		}else {
			return insert(conn, record);
		}
	}
363111
def addRecord(self, record):
        
        label_mapper    = self.labelMapper()
        icon_mapper     = self.iconMapper()
        
        self.addItem(label_mapper(record))
        self.setItemData(self.count() - 1, wrapVariant(record), Qt.UserRole)
        
        # load icon
        if icon_mapper:
            self.setItemIcon(self.count() - 1, icon_mapper(record))
        
        if self.showTreePopup():
            XOrbRecordItem(self.treePopupWidget(), record)
1241575
def add_entity(self, entity, second=False):
        ''' 
        '''
        if not entity in self._entities:
            if second:
                self._entities.append(entity)
            else:
                entity.set_world(self)
        else:
            raise DuplicateEntityError(entity)
588672
@PreUpdate
    @PrePersist
    private void changeAuditInformation(JodaAuditable auditableEntity) {
    	DateTime lastUpdated = new DateTime();
        auditableEntity.setLastUpdated(lastUpdated);
        String lastUpdatedBy = ServiceContextStore.getCurrentUser();
        auditableEntity.setLastUpdatedBy(lastUpdatedBy);
        if (auditableEntity.getCreatedDate() == null)
            auditableEntity.setCreatedDate(lastUpdated);
        if (auditableEntity.getCreatedBy() == null)
            auditableEntity.setCreatedBy(lastUpdatedBy);
    }
315619
public int insertOrUpdate(Entity record, String... keys) throws SQLException {
		Connection conn = null;
		try {
			conn = this.getConnection();
			return runner.insertOrUpdate(conn, record, keys);
		} catch (SQLException e) {
			throw e;
		} finally {
			this.closeConnection(conn);
		}
	}
633982
public void add(Rec fieldList) throws DBException
    {
        if (this.getBaseRecord() == fieldList)    // If so, set the correct record for write
            fieldList = this.moveToCurrentRecord((Record)fieldList);   // Hopefully, they supplied a default record type and this will switch it.
        if (fieldList == null)
            throw new DBException("Unknown shared record type");
        if (fieldList == this.getBaseRecord())
            super.add(fieldList);
        else
        {
            this.getBaseRecord().matchListeners((Record)fieldList, false, true, true, true, true);      // Clone the listeners that are not there already.
            fieldList.getTable().add(fieldList);
        }
    }
642588
public void doAdd(Rec record) throws DBException
    {
        try   {
            m_objLastModBookmark = m_tableRemote.add(this.getDataSource(), record.getOpenMode());
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
273999
public void addResponse(RecordResponse response) {
        if (response.getResponseSize() + getResponseSize() > 248) {
            throw new IllegalArgumentException();
        }

        if (records == null) {
            records = new RecordResponse[1];
        }
        else {
            RecordResponse old[] = records;
            records = new RecordResponse[old.length + 1];

            System.arraycopy(old, 0, records, 0, old.length);
        }
        records[records.length - 1] = response;

        setDataLength(getResponseSize());
    }
198694
public Integer addRecord(Record r) {
        Integer rId = _unsafe_add(r);
        updateMeta(r);
        return rId;
    }
253848
public void addNew() throws DBException
    {
        if (((this.getRecord().getOpenMode() & DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY) == 0)
            && ((this.getRecord().getOpenMode() & DBConstants.OPEN_READ_ONLY) != DBConstants.OPEN_READ_ONLY)
            && (this.getRecord().getCounterField() != null))
                this.getRecord().setOpenMode(this.getRecord().getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY); // Must have for MirrorTable to sync new records
        super.addNew();
        Iterator<BaseTable> iterator = this.getTables();
        while (iterator.hasNext())
        {
            BaseTable table = iterator.next();
            if ((table != null) && (table != this.getNextTable()))
            {
                table.addNew();
            }
        }
    }
1359443
public boolean add(final OIdentifiable e) {
		if (e.getIdentity().isNew()) {
			final ORecord<?> record = e.getRecord();

			// ADD IN TEMP LIST
			if (newItems == null)
				newItems = new IdentityHashMap<ORecord<?>, Object>();
			else if (newItems.containsKey(record))
				return false;
			newItems.put(record, NEWMAP_VALUE);
			setDirty();
			return true;
		} else if (OGlobalConfiguration.LAZYSET_WORK_ON_STREAM.getValueAsBoolean() && getStreamedContent() != null) {
			// FAST INSERT
			final String ridString = e.getIdentity().toString();
			final StringBuilder buffer = getStreamedContent();
			if (buffer.indexOf(ridString) < 0) {
				if (buffer.length() > 0)
					buffer.append(',');
				e.getIdentity().toString(buffer);
				setDirty();
				return true;
			}
			return false;
		} else {
			final int pos = indexOf(e);

			if (pos < 0) {
				// FOUND
				delegate.add(pos * -1 - 1, e);
				return true;
			}
			return false;
		}
	}
1299707
@Trace(dispatcher = true)
	public void updateRecord(Long recordId, Long domainId, String name, String content) throws GloboDnsException {
		NewRelic.setTransactionName(null, "/globodns/updateRecord");
		if (recordId == null) {
			throw new GloboDnsException("Record id cannot be null");
		}
		
		Record record = new Record();
		if (domainId != null)
			record.getGenericRecordAttributes().setDomainId(domainId);
		if (name != null)
			record.getGenericRecordAttributes().setName(name);
		if (content != null)
			record.getGenericRecordAttributes().setContent(content);
		
		GloboDnsRoot<Record> globoDnsRoot = this.put("/records/" + recordId + ".json", record, false);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return;
	}
715340
def update(self, eid, entity, note=None):
		
		# fetch the current entity
		newentity = self.get(eid)
		for field in ('createdAtDate', 'id', 'isActive', 'parentRevision', 'revisionNr', 'updatedAtDate', 'updatedByUserName','updatedFromIp'):
			if field in newentity: del newentity[field]

		# replace fields as specified in entity
		for field in entity:
			if field=='metadata':
				for mfield in entity['metadata']:
					newentity['metadata'][mfield] = entity['metadata'][mfield]
			else:
				newentity[field] = entity[field]

		result = self.replace(eid,newentity,note=note)
		return result
1330106
def new_record(self, key, value):
    
    new_record = self.get('new_record', {})
    ids = self.get('ids', [])

    for value in force_list(value):
        for id_ in force_list(value.get('a')):
            ids.append({
                'schema': 'SPIRES',
                'value': id_,
            })

        new_recid = force_single_element(value.get('d', ''))
        if new_recid:
            new_record = get_record_ref(new_recid, 'authors')

    self['ids'] = ids
    return new_record