ergo = (DataObject) def.parse(id.format());
ergo = new DataObject(def.parse(id.format()),def);
	public DataObject setRecordAndReturnID(Record data)			throws DatabaseException {		setRecord(data);		DataObject id = data.getField(data.getRecordDefinition()				.getPrimaryKey());		TypeDefinition def = getRecordDefinition().getFieldDef(				getRecordDefinition().getPrimaryKey());		Object ergo;		if (id == null || ((Long) id.getValue()).intValue() == 0) {			Map erg = db.executeSelectSingleRow("SELECT LAST_INSERT_ID()");			ergo = def.parse(erg.get("last_insert_id()").toString());		} else {			ergo = (DataObject) def.parse(id.format());		}		return new DataObject(ergo, def);	}