1

这是我的 HQL 查询。但是执行后,出现以下错误。我们如何解决这个问题

错误:意外令牌:d1

select d from DimensionStone d inner join d.stockRegister s where d.stockRegister.stockRegisterId <=? and s.application.applicationId=? 
    and d.isIssued='No' or (s.stockRegisterId <=? and d.isIssued='Yes' and d.issuedDate>(select max(updatedOn) from StockRegister st where st.stockRegisterId<? and st.application.applicationId=?)) and d not in(select d1 from DimensionStone d1 inner join d1.stockRegister s1 where s1.stockRegisterId <=? and s1.application.applicationId=? d1.isIssued='No'
4

2 回答 2

0
and s1.application.applicationId=? d1.isIssued='No'

您可能在?和之间遗漏了一些东西。d1and

于 2013-08-27T09:36:25.970 回答
0

在和and之间添加。s1.application.applicationId=?d1.isIssued='No'

select d from DimensionStone d inner join d.stockRegister s where d.stockRegister.stockRegisterId <=? and s.application.applicationId=? 
and d.isIssued='No' or (s.stockRegisterId <=? and d.isIssued='Yes' and d.issuedDate>(select max(updatedOn) from StockRegister st where st.stockRegisterId<? and st.application.applicationId=?)) and d not in(select d1 from DimensionStone d1 inner join d1.stockRegister s1 where s1.stockRegisterId <=? and s1.application.applicationId=? 
and d1.isIssued='No'
于 2013-08-27T09:44:09.833 回答