public function __construct($resultSet, $query)
{
$this->resultSet = $resultSet;
$repo = $query->repository();
foreach ($repo->embedded() as $embed) {
$this->embeds[$embed->property()] = $embed;
}
$this->entityClass = $repo->entityClass();
$this->repoName = $repo->name();
parent::__construct($resultSet);
}