protected function getColumnName($name)
    {
        // check attributes for given name
        if (isset($this->mapping['attributes'][$name])) {
            return $this->mapping['attributes'][$name];
        }

        // check embeddeds for given name
        foreach($this->mapping['embeddeds'] as $embedded) {
            // check for embedded attributes
            if (isset($embedded['attributes'][$name])) {
                return $embedded['attributes'][$name];
            }

            // check for embedded attributes using embedded column prefix
            if ($embedded['columnPrefix'] && strpos($name, $embedded['columnPrefix']) === 0) {
                $embeddedName = substr($name, strlen($embedded['columnPrefix']));

                if (isset($embedded['attributes'][$embeddedName])) {
                    return $embedded['attributes'][$embeddedName];
                }
            }
        }
    }