如何在JPQL中转换MySQL变量

huangapple 未分类评论48阅读模式
英文:

How to convert MySQL Variables in JPQL

问题

我想将以下 MySQL 查询转换为 JPQL:

SET @count:=0;
SELECT  (@count:=@count+1) AS serial_number, `web_address`
FROM company

我得到了以下异常:

org.hibernate.QueryException: unexpected char: '@'
英文:

I want to convert the following MySQL query to JPQL

SET @count:=0;
SELECT  (@count:=@count+1) AS serial_number, `web_address`
FROM company

I am getting the following exception.

org.hibernate.QueryException: unexpected char: '@'

huangapple
  • 本文由 发表于 2020年7月24日 21:40:15
  • 转载请务必保留本文链接:https://java.coder-hub.com/63074766.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定