Can we concatenate two properties in Hibernate HQL query?

前端 未结 4 492
感动是毒
感动是毒 2020-12-10 01:31

Lets say I have one table with two columns firstname and lastname with String datatype. Normally I write my hql query like

\"selec         


        
4条回答
  •  渐次进展
    2020-12-10 01:49

    You can also use || concatenation operator:

    "select c.firstName || ' ' || c.lastName as fullName from Contact"
    

    allthough it may be confusing to read.

提交回复
热议问题