Sets the override property mapping for an entity relationship.

@throws RuntimeException
@throws MappingException
@throws CacheException
427900
public function setPropertyOverride(Property $property) : void
    {
        $fieldName = $property->getName();

        if (! isset($this->declaredProperties[$fieldName])) {
            throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
        }

        $originalProperty          = $this->getProperty($fieldName);
        $originalPropertyClassName = get_class($originalProperty);

        // If moving from transient to persistent, assume it's a new property
        if ($originalPropertyClassName === TransientMetadata::class) {
            unset($this->declaredProperties[$fieldName]);

            $this->addProperty($property);

            return;
        }

        // Do not allow to change property type
        if ($originalPropertyClassName !== get_class($property)) {
            throw MappingException::invalidOverridePropertyType($this->className, $fieldName);
        }

        // Do not allow to change version property
        if ($originalProperty instanceof VersionFieldMetadata) {
            throw MappingException::invalidOverrideVersionField($this->className, $fieldName);
        }

        unset($this->declaredProperties[$fieldName]);

        if ($property instanceof FieldMetadata) {
            // Unset defined fieldName prior to override
            unset($this->fieldNames[$originalProperty->getColumnName()]);

            // Revert what should not be allowed to change
            $property->setDeclaringClass($originalProperty->getDeclaringClass());
            $property->setPrimaryKey($originalProperty->isPrimaryKey());
        } elseif ($property instanceof AssociationMetadata) {
            // Unset all defined fieldNames prior to override
            if ($originalProperty instanceof ToOneAssociationMetadata && $originalProperty->isOwningSide()) {
                foreach ($originalProperty->getJoinColumns() as $joinColumn) {
                    unset($this->fieldNames[$joinColumn->getColumnName()]);
                }
            }

            // Override what it should be allowed to change
            if ($property->getInversedBy()) {
                $originalProperty->setInversedBy($property->getInversedBy());
            }

            if ($property->getFetchMode() !== $originalProperty->getFetchMode()) {
                $originalProperty->setFetchMode($property->getFetchMode());
            }

            if ($originalProperty instanceof ToOneAssociationMetadata && $property->getJoinColumns()) {
                $originalProperty->setJoinColumns($property->getJoinColumns());
            } elseif ($originalProperty instanceof ManyToManyAssociationMetadata && $property->getJoinTable()) {
                $originalProperty->setJoinTable($property->getJoinTable());
            }

            $property = $originalProperty;
        }

        $this->addProperty($property);
    }
452364
protected void setProperties(Properties properties) {
        Properties oldProperties = internalProperties;
        synchronized(this) {
            internalProperties = properties;
        }
        notifyPropertiesChanged(oldProperties);
    }
438516
public InsertStrategy getOverridenStrategy(AbstractEntityProperty<?> property) {

        final InsertStrategy insertStrategy = OverridingOptional
                .from(this.insertStrategy)
                .defaultValue(property.insertStrategy())
                .get();

        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace(format("Get runtime insert strategy for entity %s : %s",
                    property.entityClass.getCanonicalName(), insertStrategy.name()));
        }

        return insertStrategy;
    }
778478
public function setProperties(array $properties = [])
    {
        foreach ($properties as $property => $value) {
            $method = 'set'.ucfirst($property);
            if (!method_exists($this, $method)) {
                throw new \RuntimeException("Undefined method $method.");
            }

            if (!in_array($property, $this->validProperties)) {
                throw new \Exception('You are trying to set invalid properties. Please check valid properties.');
            }

            $this->{$method}($value);
        }
    }
1370020
private function determineIdStrategy()
    {
        if ($this->parentMapping && $this->nodename) {
            $this->setIdGenerator(self::GENERATOR_TYPE_PARENT);

            return;
        }
        if ($this->parentMapping) {
            $this->setIdGenerator(self::GENERATOR_TYPE_AUTO);

            return;
        }
        if ($this->getIdentifier()) {
            $this->setIdGenerator(self::GENERATOR_TYPE_ASSIGNED);

            return;
        }

        throw new MappingException(sprintf(
            'No id generator could be determined in "%s". Either map a parent and a nodename field and add values to them, or map the id field and configure a mapping strategy',
            $this->name
        ));
    }
1063015
@Override
	public void afterPropertiesSet() {

		if (this.config.isUseGeneratorCache()) {

			CachedGenerator annotation = getClass().getAnnotation(CachedGenerator.class);
			if (annotation != null) {
				useCache = true;
				name = annotation.name();
				cacheMappingFileName = annotation.mappingFileName();
				cacheDirectory = annotation.cacheDirectory();
				if (!cacheDirectory.endsWith(URL_SEPARATOR)) {
					cacheDirectory = cacheDirectory + URL_SEPARATOR;
				}
				cacheMode = annotation.mode();

				loadCacheMapping();

				// reset cache if invalid
				if (!isCacheValid()) {

					if (LOGGER.isDebugEnabled()) {
						LOGGER.debug("Cache of " + getName() + " generator is invalid. Reset cache...");
					}
					resetCache();
				}
			}
		}
	}
1332234
public void assignMappedSuperClass(Map<Class<?>, ManagedType<?>> mappedSuperClass)
    {
        if (this.mappedSuperClassTypes == null)
        {
            this.mappedSuperClassTypes = mappedSuperClass;
        }
        else
        {
            this.mappedSuperClassTypes.putAll(mappedSuperClassTypes);
        }
    }
157811
public static function overrideType($name, $className)
    {
        if (!isset(self::$typesMap[$name])) {
            throw MappingException::typeNotFound($name);
        }

        self::$typesMap[$name] = $className;
    }
933313
private static void setProperty( Object bean, String key, Object value, JsonConfig jsonConfig )
         throws Exception {
      PropertySetStrategy propertySetStrategy = jsonConfig.getPropertySetStrategy() != null ? jsonConfig.getPropertySetStrategy()
            : PropertySetStrategy.DEFAULT;
      propertySetStrategy.setProperty( bean, key, value, jsonConfig );
   }
520355
private static void applyOverrides() {
        // Get the appropriate InputStream to read overrides from, if any.
        InputStream stream = getContentTypesPropertiesStream();
        if (stream == null) {
            return;
        }

        try {
            try {
                // Read the properties file...
                Properties overrides = new Properties();
                overrides.load(stream);
                // And translate its mapping to ours...
                for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    String extension = (String) entry.getKey();
                    String mimeType = (String) entry.getValue();
                    add(mimeType, extension);
                }
            } finally {
                stream.close();
            }
        } catch (IOException ignored) {
        }
    }
641832
private void setProperties(Dictionary<String, ?> d) {
        if (d == null) {
            this.properties = null;
            return;
        }

        ConfigurationDictionary newDictionary = new ConfigurationDictionary();
        Enumeration<String> keys = d.keys();
        while (keys.hasMoreElements()) {
            String key = keys.nextElement();
            if (newDictionary.get(key) == null) {
                Object value = d.get(key);
                if (value.getClass().isArray()) {
                    int arrayLength = Array.getLength(value);
                    Object copyOfArray = Array.newInstance(value.getClass().getComponentType(), arrayLength);
                    System.arraycopy(value, 0, copyOfArray, 0, arrayLength);
                    newDictionary.put(key, copyOfArray);
                } else if (value instanceof Collection) {
                    newDictionary.put(key, new Vector<Object>((Collection<?>) value));
                } else {
                    newDictionary.put(key, value);
                }
            } else
                throw new IllegalArgumentException(key + " is already present or is a case variant."); //$NON-NLS-1$
        }

        // fill in necessary properties
        if (this.factoryPid != null) {
            newDictionary.put(ConfigurationAdmin.SERVICE_FACTORYPID, this.factoryPid);
        }
        newDictionary.put(Constants.SERVICE_PID, this.pid);
        if (this.inOverridesFile) {
            newDictionary.put("config.overrides", "true");
        }

        this.properties = newDictionary;

        //we got new props so we should redo the mappings in case they changed
        addPidMapping();
    }
485623
@Override
    public void afterPropertiesSet() throws Exception {
        this.transactionTemplate = new TransactionTemplate(this.transactionManager);
        this.transactionTemplate.setPropagationBehavior(
                TransactionTemplate.PROPAGATION_REQUIRES_NEW);
        this.transactionTemplate.setReadOnly(true);
        this.transactionTemplate.afterPropertiesSet();

        this.runDatabaseTests();
        if (LOG.isDebugEnabled()) LOG.debug(this.toString());
    }
931496
public void setMapping(final Map<String, String> mapping) {
        this.uriMapping.clear();
        for (Map.Entry<String, String> entry: mapping.entrySet()) {
            Pattern pattern = Pattern.compile(entry.getKey());
            this.uriMapping.put(pattern, entry.getValue());
        }
    }
1147114
@Override
    public void set(String propName, Object value) {
        if (propName.equals("mappedProperties")) {
            getMappedProperties().add(((String) value));
        }
        super.set(propName, value);
    }
1278143
protected static function setRelationships(array &$mappedClass, Mapping $mapping, string $className)
    {
        if (!empty($mappedClass[static::RELATIONSHIPS_KEY])) {
            foreach ($mappedClass[static::RELATIONSHIPS_KEY] as $propertyName => $urls) {
                if (false === \in_array($propertyName, static::getClassProperties($className))) {
                    throw new MappingException(
                        \sprintf(
                            'Could not find property %s in class %s because it does not exist.',
                            $propertyName,
                            $className
                        )
                    );
                }

                $mapping->setRelationshipUrls($propertyName, $urls);
            }
        }
    }
465622
@SuppressWarnings("rawtypes")
   @Override
   public void configure(Map props) throws HibernateException
   {
      try {
         LOGGER.debug("Configuring HikariCP");

         this.hcfg = HikariConfigurationUtil.loadConfiguration(props);
         this.hds = new HikariDataSource(this.hcfg);

      }
      catch (Exception e) {
         throw new HibernateException(e);
      }

      LOGGER.debug("HikariCP Configured");
   }
725810
public function setInheritanceType($type)
    {
        if ( ! $this->_isInheritanceType($type)) {
            throw MappingException::invalidInheritanceType($this->name, $type);
        }
        $this->inheritanceType = $type;
    }