public static function parseColumn($query, $column)
    {
        $repository = $query->getRepository();
        $description = $repository->getDescription();
        $parts = explode('.', $column, 2);
        $attribute = isset($parts[1]) ? $parts[1] : null;
        $result = array('columns' => null, 'property' => null);
        //don't check the parent properties
        if ($property = $description->getProperty($parts[0], false)) {
            if ($property->isAttribute()) {
                $result['property'] = $property;
                $result['columns'] = $property->getColumn();
            } elseif ($property->isRelationship()) {
                if ($property->isManyToOne()) {
                    //join the query for the belongs to relationship
                    $result['columns'] = $columns = $property->getColumns();
                    $result['property'] = $property;
                    if ($attribute && isset($columns[$attribute])) {
                        $result['columns'] = $columns[$attribute];
                    } elseif ($attribute) {
                        $result = self::_parseManyToOne($query, $property, $attribute);
                    }
                } elseif ($property->isManyToMany()) {
                    $result = self::_parseManyToMany($query, $property, $attribute);
                    if (!$attribute) {
                        $result['columns'] = array();
                    }
                } elseif ($property->isOneToMany()) {
                    $result = self::_parseOneToMany($query, $property, $attribute);
                }

                return $result;
            }
        } elseif (isset($query->link[$parts[0]])) {
            $query = $query->link[$parts[0]]['query'];
            $result = self::parseColumn($query, $parts[1]);
        }

        return $result;
    }