Ebean setIncludeSoftDeletes()抛出SQLException

时间:2018-08-28 11:11:11

标签: playback ebean soft-delete playframework-2.6

我有两个表,每个表都有@History和@SoftDelet。当我使用未删除的数据时,就可以了。但是,当我尝试使用setIncludeSoftDeletes()找到包含带有EAGER加载选项的字段的模型的已删除数据时:

select sum(value)
from (select d.*,
             lag(value) over (order by time) as prev_value,
             lead(value) over (order by time) as next_value,
             lead(value, 2) over (order by time) as next_value2
      from d
     ) d
where value > prev_value and value > next_value and
      value > next_value2;

我遇到异常:

  

查询引发SQLException:没有为参数2指定值绑定值:[1,]查询为:从t2 t0中选择t0.id,t0.deleted,t1.id左连接t1.t2_id = t0.id上的t1_with_history t1和(t1.sys_period_start <=?和(t1.sys_period_end为null或t1.sys_period_end>?)),其中t0.id =?

为什么添加了带有视图t1_with_history的联接?

模型

t2.find.query().setId(id).setIncludeSoftDeletes().findOne();

0 个答案:

没有答案