Call mysql nested/inner functions in querydsl

后端 未结 1 1169
长发绾君心
长发绾君心 2021-01-14 17:43

I need to run the following query in QueryDsl Native MySQL.

SELECT cast(json_unquote(JSON_EXTRACT(vendor_master,\'$.vendor.currency\')) as char) as currency         


        
1条回答
  •  不思量自难忘°
    2021-01-14 18:07

    I found the answer for the question.

    SimpleExpression exp=Expressions.simpleTemplate(String.class,"cast(json_unquote(json_extract({0},{1})) as char) as currency",vendor.vendorMaster,"$.vendor.currency"); 
    List tuples=sqlQueryFactory.select(exp).from(vendor).fetch();
    

    Thanks for your response.

    0 讨论(0)
提交回复
热议问题