#!/usr/bin/env python3
"""
#exonware/xwquery/src/exonware/xwquery/parsers/hql_parser.py
HQL parser - Hibernate Query Language (ORM-oriented SQL).
Extends SQL parser with object-oriented features.
Company: eXonware.com
Author: eXonware Backend Team
Email: connect@exonware.com
Version: 0.0.1.8
Generation Date: 28-Oct-2025
"""

from .sql_parser import SQLParser
from ...contracts import QueryAction
from ...defs import ConversionMode


class HQLParser(SQLParser):
    """
    HQL parser for Hibernate queries.
    Extensions over SQL:
    - Object navigation (user.address.street)
    - Polymorphic queries
    - Fetch joins
    - Native SQL embedding
    Reuses: 75% of SQL parser
    """

    def get_format_name(self) -> str:
        return "HQL"


def parse_hql(query: str, **options) -> list[QueryAction]:
    """Parse HQL query to QueryAction tree."""
    parser = HQLParser()
    return parser.parse_with_validation(query, **options)
__all__ = ['HQLParser', 'parse_hql']
