Trace the HQL

Use the following methods to check the HQL Query from the Pricefx Studio.

  • .traceQuery()

  • .queryString()

Code

Groovy
def qapi = api.queryApi()
def p = qapi.tables().products()

return qapi.source(p, [p.sku(), p.label], p.sku().equal("MB-0001"))
        .traceQuery()
        .stream { it.collect { it } }

Result

SQL
SQL		
    SELECT
        Product_0.sku as sku,
        Product_0.label as label                
    FROM
        Product as Product_0                  
    WHERE
        (
            Product_0.sku = cast('MB-0001' as string)                           
        )                            
        AND (
            (
                Product_0.partition.id = cast(40948 as long)                                       
            )                                        
            AND (
                Product_0.isDeleted <> TRUE                                       
            )                           
        )