INTERNAL:
Adds a named query to this class.

@param array $queryMapping

@return void

@throws MappingException
439295
public function addNamedQuery(array $queryMapping)
    {
        if (!isset($queryMapping['name'])) {
            throw MappingException::nameIsMandatoryForQueryMapping($this->name);
        }

        if (isset($this->namedQueries[$queryMapping['name']])) {
            throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
        }

        if (!isset($queryMapping['query'])) {
            throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
        }

        $name   = $queryMapping['name'];
        $query  = $queryMapping['query'];
        $dql    = str_replace('__CLASS__', $this->name, $query);
        $this->namedQueries[$name] = array(
            'name'  => $name,
            'query' => $query,
            'dql'   => $dql
        );
    }
1289365
public function addInheritedAssociationMapping(array $mapping/*, $owningClassName = null*/)
    {
        if (isset($this->associationMappings[$mapping['fieldName']])) {
            throw MappingException::duplicateAssociationMapping($this->name, $mapping['fieldName']);
        }
        $this->associationMappings[$mapping['fieldName']] = $mapping;
    }
1239091
public function addNamedNativeQueryMapping(ClassMetadataInfo $class, array $queryMapping)
    {
        if (isset($queryMapping['resultClass'])) {
            return $this->addNamedNativeQueryResultClassMapping($class, $queryMapping['resultClass']);
        }

        return $this->addNamedNativeQueryResultSetMapping($class, $queryMapping['resultSetMapping']);
    }
1264060
public void setMapping(SQLPPTriplesMap mapping) {
		this.mapping = mapping;

		cmdInsertMapping.setText("Update");
		txtMappingID.setText(mapping.getId());

		OBDASQLQuery sourceQuery = mapping.getSourceQuery();
		String srcQuery = SourceQueryRenderer.encode(sourceQuery);
		txtSourceQuery.setText(srcQuery);

		ImmutableList<TargetAtom> targetQuery = mapping.getTargetAtoms();
		String trgQuery = TargetQueryRenderer.encode(targetQuery, prefixManager);
		txtTargetQuery.setText(trgQuery);
	}
212575
public function setDiscriminatorMap(array $map)
    {
        foreach ($map as $value => $className) {
            if (strpos($className, '\\') === false && strlen($this->namespace)) {
                $className = $this->namespace . '\\' . $className;
            }
            $this->discriminatorMap[$value] = $className;
            if ($this->name == $className) {
                $this->discriminatorValue = $value;
            } else {
                if ( ! class_exists($className)) {
                    throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
                }
                if (is_subclass_of($className, $this->name)) {
                    $this->subClasses[] = $className;
                }
            }
        }
    }
1212351
public function register($entity, $entityMap = null)
    {
        // If an object is provider, get the class name from it
        if (!is_string($entity)) {
            $entity = get_class($entity);
        }

        if ($this->isRegisteredEntity($entity)) {
            throw new MappingException("Entity $entity is already registered.");
        }

        if (!class_exists($entity)) {
            throw new MappingException("Class $entity does not exists");
        }

        if ($entityMap === null) {
            $entityMap = $this->getEntityMapInstanceFor($entity);
        }

        if (is_string($entityMap)) {
            $entityMap = new $entityMap();
        }

        if (!$entityMap instanceof EntityMap) {
            throw new MappingException(get_class($entityMap).' must be an instance of EntityMap.');
        }

        $entityMap->setClass($entity);

        $this->entityClasses[$entity] = $entityMap;
    }
116553
public function setMappings(array $mappings) {
        $this->mappings = [];

        foreach ($mappings as $contentType => $dataClass) {
            $this->addMapping($contentType, $dataClass);
        }
    }
1122260
protected function initialize()
    {
        if (!is_array($this->queryResult)) {
            $this->queryResult = $this->dataMapper->mapToObjects($this->persistenceManager->getObjectDataByQuery($this->query));
        }
    }
932795
private function addMappings(FluentDriver $mappingDriver)
    {
        $mappingDriver->addMapping(new NameMapping);
        $mappingDriver->addMapping(new EmailMapping);
        $mappingDriver->addMapping(new PasswordMapping);
    }
390943
public void addMapping(Mapping mapping)
    {
        if (mapping != null)
        {
            mappings.put(mapping.getType(), mapping);
        }
    }
242846
public function addMapping(ImsManifestMapping $mapping)
    {
        $mappings = $this->getMappings();

        $ns = $mapping->getNamespace();

        if (isset($mappings[$ns]) === false) {
            $mappings[$ns] = $mapping;
        }

        $this->setMappings($mappings);
    }
133323
public function addDefaultQueryParameters($queryParameters)
    {
        foreach ($queryParameters as $name => $value) {
            $this->addDefaultQueryParameter($name, $value);
        }

        return $this;
    }
151613
public function getNamedQuery($queryName)
    {
        if ( ! isset($this->namedQueries[$queryName])) {
            throw MappingException::queryNotFound($this->name, $queryName);
        }
        return $this->namedQueries[$queryName]['dql'];
    }
536086
protected function checkBindings(string $query, array $bindings)
    {
        $bindingsCountInQuery = $this->countBindingsFromQuery($query);
        $bindingsCount = count($bindings);

        if ($bindingsCountInQuery !== $bindingsCount) {
            throw QueryMapperException::wrongBindingsNumber($bindingsCountInQuery, $bindingsCount);
        }

        $this->checkBindingsPolicy($bindings);
    }
260080
protected function setMappings(array $mappings = array())
    {
        foreach ($mappings as $mapping) {
            if (!$mapping instanceof ImsManifestMapping) {
                $msg = "The mappings argument must be an array composed of ImsManifestMapping objects";
                throw new InvalidArgumentException($msg);
            }
        }

        $this->mappings = $mappings;
    }
877851
public function addInheritedFieldMapping(array $fieldMapping)
    {
        if (!isset($this->fieldMappings[$fieldMapping['fieldName']])) {
            $this->fieldMappings[$fieldMapping['fieldName']] = $fieldMapping;
            $this->xmlFieldMap[$fieldMapping['name']] = $fieldMapping['fieldName'];
        }
    }
64374
public void add(T queryParameter) {
		Assert.notNull(queryParameter, "QueryParameter must not be null!");
		this.parameters.put(queryParameter.getName(), queryParameter);
	}