public function getEntityMetadata($shallow = false)
{
$entity = new Entity($this->reflection_obj->name, $this->getTableName());
$entity->setColumns($this->getColumns());
if (!$shallow) {
$entity->setRelationships($this->getRelationships());
}
$entity->setIndices($this->getIndices());
$entity->setSortables($this->getSortables());
return $entity;
}