private function removeMappingsFromTraits(ClassMetadata $metadata): void
    {
        $traits = $this->getTraits($metadata->name);

        foreach ($traits as $trait) {
            $trait = new \ReflectionClass($trait);

            /**
             * @var \ReflectionProperty $property
             */
            foreach ($trait->getProperties() as $property) {
                $name = $property->getName();

                if (isset($metadata->fieldMappings[$name])) {
                    $mapping = $metadata->fieldMappings[$name];

                    unset(
                        $metadata->fieldMappings[$name],
                        $metadata->fieldNames[$mapping['columnName']],
                        $metadata->columnNames[$name]
                    );
                }
            }
        }
    }