How do I write hql query with cast?

后端 未结 4 601
悲&欢浪女
悲&欢浪女 2020-12-06 09:04

I need to combine 2 tables using hql, both are having common column, but table1 common column is integer and table2 common column is <

4条回答
  •  臣服心动
    2020-12-06 09:46

    I had to cast it to String like so :

     @Query( value = "select new com.api.models.DResultStatus("+
                "cast(ds.demoId as java.lang.String),cast(ds.comp as java.lang.String),cast(ds.dc as java.lang.String),cast(be.buildUrl as java.lang.String)")
    

提交回复
热议问题