Used to get the value from a field
@param query
@param field_name
@return
@throws Exception
348286
public QueryBuilder mapField(String query, String field_name) throws Exception {
        JSONObject op = new JSONObject();

        if (query != null)
            op.put(Constants.REQUEST_QUERY, query);

        op.put(Constants.REQUEST_FIELD, field_name);

        JSONArray operations = (JSONArray) request.get(Constants.REQUEST_OPERATIONS);
        operations.put(op);
        request.remove(Constants.REQUEST_OPERATIONS);
        request.put(Constants.REQUEST_OPERATIONS, operations);

        return this;
    }
435590
public function getFieldValues(string $field_name)
    {
        try {
            $field = [];
            $result = $this->stmt->fetchAll(\PDO::FETCH_ASSOC);
            if (array_key_exists($field_name, $result[0])) {
                foreach ($result as $row) {
                    $field[] = $row[$field_name];
                }
            } else {
                throw new \Exception("Field '$field_name' is not present in the current result set.\n");
            }
            return $field;
        } catch (\PDOException $e) {
            die('Error: ' . $e->getMessage());
        } catch (\Exception $e) {
            die("Error: " . $e->getMessage());
        }
    }
823212
def get(self, field_name, default=None):
        """"""
        checkFieldName(field_name)
        return self.data.get(field_name, default)
51059
public function getField($name) {
    if (isset($this->fields[$name])) {
      return $this->record[$name];
    }

    if (isset($this->fetchedRecord[$name])) {
      return $this->fetchedRecord[$name];
    }

    throw new \Exception('Not a valid Field for Get ' . $name);
  }
993757
def search_exception(exception, delegate = nil)
      query = ExceptionHound.new(exception).query
      search_query(query, delegate)
    end
368103
def get_field(self, field_name):
        """"""
        for attr_name, field in self:
            if field_name == attr_name:
                return field

        raise errors.FieldNotFound('Field not found', field_name)
1047596
protected function getResults($query)
    {
         $searchFields = ($this->getSearchFields() ?: singleton($this->sourceObject)->stat('searchable_fields'));

        if(!$searchFields) {
            throw new Exception(
                sprintf('HasOneAutocompleteField: No searchable fields could be found for class "%s"',
                $this->sourceObject));
        }

        $params = [];
        $sort = [];
        
        foreach($searchFields as $searchField) {
            $name = (strpos($searchField, ':') !== FALSE) ? $searchField : "$searchField:PartialMatch:nocase";
            $params[$name] = $query;
            $sort[$searchField] = "ASC";
        }

        $results = DataList::create($this->sourceObject)
            ->filterAny($params)
            ->sort($sort)
            ->limit($this->getResultsLimit());

        return $results;
    }
1265340
public function parseFql($fieldName, $query)
    {
        // 
        if(is_string($query)) {
            // 
            $lexer = $this->createLexer((string)$query);
            
            $field = new Expr\FieldIdentifier($fieldName);
            try {
                $expr = $this->doParseExpression($lexer, $field);
            } catch(\Exception $ex) {
                throw new ParserException(sprintf('Failed to parse qeury "%s"', $query), 0, $ex);
            }

            if(!$lexer->isEol()) {
                throw new ParserException(sprintf('Invalid query "%s"', $lexer->remain()));
            }

            return $expr;
        } else if(is_array($query)) {
            $exprs = array();
            foreach($query as $q) {
                $exprs[] = $this->parseFql($fieldName, $q);
            }

            //return new Expr\AndX($exprs);
            return new Expr\LogicalExpression($exprs, Expr\LogicalExpression::TYPE_AND);
        } else {
            return new Expr\ComparisonExpression($field, $query, Expr\ComparisonExpression::EQ);
        }

        throw new ParserException('Invalid Fql query.');
    }
995033
public function getField($field_name)
    {
        $field = null;
        
        if (isset($this->m_fields[$field_name]))
        {
            $field = $this->m_fields[$field_name];
        }
        else
        {
            $err_msg = '[' . $field_name . '] does not exist in table ' .
                       '[' . $this->m_name . ']';
            
            throw new \Exception($err_msg);
        }
        
        return $field;
    }
118931
static List<JmxData> query(MBeanServer server, ObjectName query) throws Exception {
    List<JmxData> data = new ArrayList<>();

    Set<ObjectName> names = server.queryNames(query, null);
    LOGGER.trace("query [{}], found {} matches", query, names.size());
    for (ObjectName name : names) {
      MBeanInfo info = server.getMBeanInfo(name);
      MBeanAttributeInfo[] attrs = info.getAttributes();
      String[] attrNames = new String[attrs.length];
      for (int i = 0; i < attrs.length; ++i) {
        attrNames[i] = attrs[i].getName();
      }

      Map<String, String> stringAttrs = new HashMap<>();
      stringAttrs.put("domain", name.getDomain());
      Map<String, Number> numberAttrs = new HashMap<>();

      for (Attribute attr : server.getAttributes(name, attrNames).asList()) {
        Object obj = attr.getValue();
        if (LOGGER.isTraceEnabled()) {
          LOGGER.trace("attribute [{}][{}] = {}", name, attr.getName(), mkString(obj));
        }

        if (obj instanceof String) {
          stringAttrs.put(attr.getName(), (String) obj);
        } else if (obj instanceof Number) {
          numberAttrs.put(attr.getName(), ((Number) obj).doubleValue());
        } else if (obj instanceof CompositeDataSupport) {
          CompositeDataSupport composite = (CompositeDataSupport) obj;
          CompositeType compositeType = composite.getCompositeType();
          for (String key : compositeType.keySet()) {
            if (composite.containsKey(key)) {
              Object o = composite.get(key);
              String attrKey = attr.getName() + "." + key;
              if (o instanceof Number) {
                numberAttrs.put(attrKey, ((Number) o).doubleValue());
              } else if (o instanceof String) {
                stringAttrs.put(attrKey, (String) o);
              } else if (o instanceof TimeUnit) {
                stringAttrs.put(attrKey, o.toString());
              }
            }
          }
        } else if (obj instanceof TimeUnit) {
          stringAttrs.put(attr.getName(), obj.toString());
        }
      }

      // Add properties from ObjectName after attributes to ensure they have a higher
      // priority if the same key is used both in the Object and as an attribute
      stringAttrs.putAll(name.getKeyPropertyList());

      data.add(new JmxData(name, stringAttrs, numberAttrs));
    }

    return data;
  }
941302
@SuppressWarnings("unchecked")
    @Override
    public final V getEntity(final NamedParameterQueryData query) {
        final Query builtQuery; // Query created from the query data
        V entity; // Entity acquired from the query

        checkNotNull(query, "Received a null pointer as the query");

        // Builds the query
        builtQuery = buildQuery(query);

        // Tries to acquire the entity
        try {
            entity = (V) builtQuery.getSingleResult();
        } catch (final NoResultException exception) {
            entity = null;
        }

        return entity;
    }
740599
@Override
  public final void executeQuery(final String pQuery) throws Exception {
    try {
      if (getLogger().getIsShowDebugMessagesFor(getClass())
        && getLogger().getDetailLevel() > 30000) {
        getLogger().debug(null, SrvDatabase.class, "try to execute query: "
          + pQuery);
      }
      this.sqliteDatabase.execSQL(pQuery);
    } catch (Exception ex) {
      String msg = ex.getMessage() + ", query:\n" + pQuery;
      ExceptionWithCode ewc = new ExceptionWithCode(SrvDatabase.SQL_EXEC_ERROR,
        msg);
      ewc.setStackTrace(ex.getStackTrace());
      throw ewc;
    }
  }
241544
public function getField($name, $throw = false)
    {
        $name = $this->convertToPrimaryKeyName($name);
        if (false === self::getMeta()->hasField($name)) {
            if ($throw) {
                throw new Exception('Unknown field');
            }

            return;
        }

        $field = self::getMeta()->getField($name);
        $field->setModel($this);

        return $field;
    }
1205668
def get_field_value(self, field, context):
        
        name = field.getName()
        value = context.getField(name).get(context)
        logger.info("get_field_value: context={} field={} value={}".format(
            context, name, value))
        return value
42406
def get_value(self, field_name):
        
        if field_name in self.fields:
            return self._dict['attributes'][field_name]
        elif field_name.upper() in ['SHAPE', 'SHAPE@', "GEOMETRY"]:
            return self._dict['geometry']
        return None
1335044
@Override
    @SuppressWarnings("StringEquality")
    public Object getField(String name) throws UnresolvedException{
        if(name=="method")
            return method==null ? null : method.toString();
        else if(name=="uri")
            return uri;
        else if(name=="line")
            return method+" "+uri+' '+version;
        else if(name=="query_string"){
            if(uri==null)
                return null;
            int question = uri.indexOf('?');
            return question==-1 ? "" : uri.substring(question+1);
        }else if(name=="cookies")
            return getCookies();
        else
            return super.getField(name);
    }
759298
public function query($query_with_placeholders, $named_parameters = []) {
            Event::dispatch(EventData::forBefore(Event::BEFORE_QUERY, '', $named_parameters, $query_with_placeholders), $named_parameters);
            try {
                $stmt = $this->prepareStatement($query_with_placeholders, $named_parameters);
                $stmt->execute();
            } catch (Exception $ex) {
                Event::dispatch(EventData::forException($ex, $query_with_placeholders, $named_parameters));
                throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
            }

            Event::dispatch(EventData::forAfter(Event::AFTER_QUERY, null, $named_parameters, $query_with_placeholders, $stmt->rowCount()));

            return $this->fetch($stmt);
        }