Populate the instance variables using the specified DB row.
549962
def populateFromRow(self, readGroupRecord):
        
        self._sampleName = readGroupRecord.samplename
        self._biosampleId = readGroupRecord.biosampleid
        self._description = readGroupRecord.description
        self._predictedInsertSize = readGroupRecord.predictedinsertsize
        stats = protocol.fromJson(readGroupRecord.stats, protocol.ReadStats)
        self._numAlignedReads = stats.aligned_read_count
        self._numUnalignedReads = stats.unaligned_read_count
        experiment = protocol.fromJson(
            readGroupRecord.experiment, protocol.Experiment)
        self._instrumentModel = experiment.instrument_model
        self._sequencingCenter = experiment.sequencing_center
        self._experimentDescription = experiment.description
        self._library = experiment.library
        self._platformUnit = experiment.platform_unit
        self._runTime = experiment.run_time
667557
public static function populateRecord($record, $row)
    {
        $attributes = [];
        if (isset($row['_source'])) {
            $attributes = $row['_source'];
        }
        if (isset($row['fields'])) {
            // reset fields in case it is scalar value
            $arrayAttributes = $record->arrayAttributes();
            foreach($row['fields'] as $key => $value) {
                if (!isset($arrayAttributes[$key]) && count($value) === 1) {
                    $row['fields'][$key] = reset($value);
                }
            }
            $attributes = array_merge($attributes, $row['fields']);
        }

        parent::populateRecord($record, $attributes);

        $pk = static::primaryKey()[0];//TODO should always set ID in case of fields are not returned
        if ($pk === '_id') {
            $record->_id = $row['_id'];
        }
        $record->_highlight = isset($row['highlight']) ? $row['highlight'] : null;
        $record->_score = isset($row['_score']) ? $row['_score'] : null;
        $record->_version = isset($row['_version']) ? $row['_version'] : null; // TODO version should always be available...
        $record->_explanation = isset($row['_explanation']) ? $row['_explanation'] : null;
    }
439618
def init(cls, *args, **kwargs):
        """"""
        instance = cls()
        instance._values.update(dict(*args, **kwargs))
        return instance
27553
def add(self, instance):
        '''
        
        '''

        table = instance.__class__.__name__.lower()
        keys = ", ".join(vars(instance).keys())
        values = tuple(vars(instance).values())

        SQL = """INSERT INTO %s (%s) VALUES(""" % (table, keys)
        SQL += """ "%s",""" * len(values) % (values)
        SQL = SQL[:-1] + ")"

        if self.DEBUG: print(SQL)

        with Session(self.settings) as conn:
            try:
                c = conn.cursor()
                c.execute(SQL)
                conn.commit()
                return True
            except mysql.Error as e:
                if e.errno==1062:
                    print("Already saved to the database")
                    return True
                elif e.errno == 1146:
                    # Table does not exist
                    return True
                else:
                    raise e

                return True
894498
public void populateSalary(ResultSet row, ObjectNode s) throws SQLException {
    s.put("employeeId", row.getInt("emp_no"));
    s.put("salary", row.getInt("salary"));
    Calendar fromDate = Calendar.getInstance();
    fromDate.setTime(row.getDate("from_date"));
    s.put("fromDate", dateFormat.format(fromDate.getTime()));
    Calendar toDate = Calendar.getInstance();
    toDate.setTime(row.getDate("to_date"));
    s.put("toDate", dateFormat.format(toDate.getTime()));
  }
791485
def _executing(self, sql, params=[]):
        
        with self.connection() as connection:
            for row in connection.execute(sql, params):
                yield row
                if not self._db:
                    return
608838
def populate_records(self):
        

        self.object_list = self.get_valuesqueryset(self.object_list)
        super(ValuesDatatable, self).populate_records()
1145275
def populateFromRow(self, ontologyRecord):
        
        self._id = ontologyRecord.id
        self._dataUrl = ontologyRecord.dataurl
        self._readFile()
992684
private synchronized void populateFromDbHelper(Map<Long, ResourceGroupSpecBuilder> recordMap,
            Set<Long> rootGroupIds,
            Map<Long, ResourceGroupIdTemplate> resourceGroupIdTemplateMap,
            Map<Long, Set<Long>> subGroupIdsToBuild)
    {
        List<ResourceGroupSpecBuilder> records = dao.getResourceGroups(environment);
        for (ResourceGroupSpecBuilder record : records) {
            recordMap.put(record.getId(), record);
            if (!record.getParentId().isPresent()) {
                rootGroupIds.add(record.getId());
                resourceGroupIdTemplateMap.put(record.getId(), new ResourceGroupIdTemplate(record.getNameTemplate().toString()));
            }
            else {
                subGroupIdsToBuild.computeIfAbsent(record.getParentId().get(), k -> new HashSet<>()).add(record.getId());
            }
        }
    }
762375
private void populatePartialRowForEmbeddedColumn(PartialRow row, EmbeddableType embeddable, Object EmbEntity,
            MetamodelImpl metaModel)
    {
        Set<Attribute> attributes = embeddable.getAttributes();
        Iterator<Attribute> iterator = attributes.iterator();
        iterateAndPopulateRow(row, EmbEntity, metaModel, iterator);
    }
295200
def set_db_row(db, start, size, _bytearray):
    
    client.db_write(db, start, size, _bytearray)
437728
def populate_schema_objects(self, schema, obj_type):
        """"""
        metadata = self.dbmetadata[obj_type]
        schema = schema or self.dbname

        try:
            objects = metadata[schema].keys()
        except KeyError:
            # schema doesn't exist
            objects = []

        return objects
193128
private Object populateEntityFromDataFrame(EntityMetadata m, Map<String, Integer> columnIndexMap, Row row)
    {
        try
        {
            // create entity instance
            Object entity = KunderaCoreUtils.createNewInstance(m.getEntityClazz());
            // handle relations
            Map<String, Object> relations = new HashMap<String, Object>();
            if (entity.getClass().isAssignableFrom(EnhanceEntity.class))
            {
                relations = ((EnhanceEntity) entity).getRelations();
                entity = ((EnhanceEntity) entity).getEntity();
            }
            // get a Set of attributes
            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                    m.getPersistenceUnit());
            EntityType entityType = metaModel.entity(m.getEntityClazz());
            Set<Attribute> attributes = ((AbstractManagedType) entityType).getAttributes();
            // iterate over attributes and find its value
            for (Attribute attribute : attributes)
            {
                String columnName = getColumnName(attribute);
                Object columnValue = row.get(columnIndexMap.get(columnName));
                if (columnValue != null)
                {
                    Object value = PropertyAccessorHelper.fromSourceToTargetClass(attribute.getJavaType(),
                            columnValue.getClass(), columnValue);

                    PropertyAccessorHelper.set(entity, (Field) attribute.getJavaMember(), value);
                }
            }
            // find the value of @Id field for EnhanceEntity
            SingularAttribute attrib = m.getIdAttribute();
            Object rowKey = PropertyAccessorHelper.getObject(entity, (Field) attrib.getJavaMember());
            if (!relations.isEmpty())
            {
                return new EnhanceEntity(entity, rowKey, relations);
            }
            return entity;
        }
        catch (PropertyAccessException e1)
        {
            throw new RuntimeException(e1);
        }
    }
307583
def populate(amount, options = {}, &block)
      self.class.remember_depth do
        build_records(Populator.interpret_value(amount), options[:per_query] || DEFAULT_RECORDS_PER_QUERY, &block)
      end
    end
1190572
private void populateMetaData() throws SQLException
   {
      m_meta.clear();

      ResultSetMetaData meta = m_rs.getMetaData();
      int columnCount = meta.getColumnCount() + 1;
      for (int loop = 1; loop < columnCount; loop++)
      {
         String name = meta.getColumnName(loop);
         Integer type = Integer.valueOf(meta.getColumnType(loop));
         m_meta.put(name, type);
      }
   }
169225
private String createRow(String key, String appid, Map<String, AttributeValue> row) {
		if (StringUtils.isBlank(key) || StringUtils.isBlank(appid) || row == null || row.isEmpty()) {
			return null;
		}
		try {
			key = getKeyForAppid(key, appid);
			setRowKey(key, row);
			PutItemRequest putItemRequest = new PutItemRequest(getTableNameForAppid(appid), row);
			client().putItem(putItemRequest);
		} catch (Exception e) {
			logger.error("Could not write row to DB - appid={}, key={}", appid, key, e);
			throwIfNecessary(e);
		}
		return key;
	}
1215379
private void populateEntityMap() throws SQLException
   {
      for (Row row : getRows("select * from z_primarykey"))
      {
         m_entityMap.put(row.getString("Z_NAME"), row.getInteger("Z_ENT"));
      }
   }