public function merge(EntityMetadata $metadata)
    {
        $this->setType($metadata->type);
        $this->setAbstract($metadata->isAbstract());
        $this->setPolymorphic($metadata->isPolymorphic());
        $this->extends = $metadata->extends;
        $this->mergeAttributes($metadata->getAttributes());
        $this->mergeRelationships($metadata->getRelationships());
        return $this;
    }