private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass)
    {
        if (! $parentClass->isMappedSuperclass) {
            return;
        }

        foreach (array('uniqueConstraints', 'indexes') as $indexType) {
            if (isset($parentClass->table[$indexType])) {
                foreach ($parentClass->table[$indexType] as $indexName => $index) {
                    if (isset($subClass->table[$indexType][$indexName])) {
                        continue; // Let the inheriting table override indices
                    }

                    $subClass->table[$indexType][$indexName] = $index;
                }
            }
        }
    }