private function propertyNeedsMapping(ClassMetadata $class, \ReflectionProperty $property)
    {
        if ($class->isMappedSuperclass && !$property->isPrivate()) {
            return false;
        }

        $inherited = $class->hasAttribute($property->name) && $class->getPropertyMetadata($property->name)->isInherited;

        return !$inherited || $property->getDeclaringClass()->name === $class->name;
    }