我正在使用 jinq 版本 1.8.11 和休眠版本 4.3 使用休眠会话工厂而不是实体管理器。
我正在尝试以下查询:
JPAJinqStream<Routine> routineStream = stream.streamAll(getCurrentSession(), Routine.class);
if (text.isPresent()) {
final String searchText = text.get();
routineStream = routineStream
.leftOuterJoin(
(r, source) -> source.stream(NLSProperty.class),
(r, nls) -> nls.getVarKey().equals("routine.100.title")
).select(pair -> pair.getOne());"%" + searchText + "%")).select(Pair::getOne);
}
List<Routine> tp = routineStream.toList();
当变量文本不存在时,查询有效,我得到结果。当变量文本存在时,我收到以下错误:
java.lang.IllegalStateException: DOT node with no left-hand-side!
任何想法我做错了什么?
我已经调试了 jinq,它生成的查询如下所示:
SELECT A FROM de.etherapists.ehealth.model.routine.Routine A LEFT OUTER JOIN de.etherapists.ehealth.model.NLSProperty B ON B.varKey = 'routine.100.title';
谢谢