public function query(QueryInterface $query, ClassMetadata $metadata)
    {
        $field = $this->mapping['fieldname'];

        /** @var SelectQuery $query */
        foreach ($query->getFilters() as $filter) {
            /** @var Filter $filter */
            if ($filter->getKey() == $field) {
                $this->rewriteQueryFilterParameters($filter, $query, $field);
            }
        }

        return null;
    }