HQL:将"insert into ... select"与固定参数值组合在一起

Tim*_*pov 6 hibernate hql

我有HQL声明:

insert into Item (ost, value, comments, startTime, endTime, proposedBy) 
select si.ost, si.value, si.comments, si.endTime, si.endTime, u 
from Item si, User u 
where si.ost = ? and u.id = ?
Run Code Online (Sandbox Code Playgroud)

如何修改为从其他列中使用参数的值oststartTimeselect

bog*_*anb 0

\xe2\x80\x99t可以在HQL中完成吗?它不允许在 select 子句中引用参数。

\n

  • 你有这方面的参考吗? (4认同)