protected function assertTroughKeys($inKeys, $outKeys)
    {
        if (empty($inKeys) || empty($outKeys)) {
            throw new DefinitionException(sprintf('Invalid keys for relation "%s", must be two arrays with key-value pairs', $this->entity, count($inKeys)));
        }

        if (count($inKeys) !== count($outKeys)) {
            throw new DefinitionException(sprintf('Both key arrays for relation "%s", must have the same number of elements', $this->entity));
        }
    }