public function validateMetadataType(EntityMetadata $metadata)
    {
        if (true === $metadata->isChildEntity()) {
            $parentType = $metadata->getParentEntityType();
            if (0 !== strpos($metadata->type, $parentType)) {
                throw MetadataException::invalidMetadata($metadata->type, sprintf('Child class types must be prefixed by the parent class. Expected "%s" prefix.', $parentType));
            }
        }
        if (false === $this->isEntityTypeValid($metadata->type)) {
            throw MetadataException::invalidMetadata($metadata->type, sprintf('The entity type is invalid based on the configured name format "%s"', $this->config->getEntityFormat()));
        }
        return true;
    }