private function validateSchemata(EntityMetadata $metadata)
    {
        $persistence = $metadata->persistence;
        foreach ($persistence->schemata as $k => $schema) {
            if (!isset($schema['keys']) || empty($schema['keys'])) {
                throw MetadataException::invalidMetadata($metadata->type, 'At least one key must be specified to define an index.');
            }
            $persistence->schemata[$k]['options']['name'] = sprintf('modlr_%s', md5(json_encode($schema)));
        }
    }