我正在尝试在集合上使用querydsl。
我的 list 是 List<String>
.
第一个问题,是否可以在原始类型集合上使用querydsl?
此后,我如何构建如下查询:give all strings which there aren't in list x
?
我已经尝试过这个:
String digitalResourceId;
for (String resource : from(digitalResourceId, digitalResourceIds)
.where(fua.getResources().any().eq(digitalResourceId))
.list(digitalResourceId)){
System.out.println(resource);
}
但是我在 any()
上遇到了编译问题方法:
The method any() is undefined for the type List<String>
最佳答案
List<String> x = ...
List<String> output = queryFactory.selectFrom(resource_table.resourceId)
.where(resource_table.resourceId.notIn(x))
.fetch();
关于java - 集合上的 QueryDSL -> 字符串列表的任何(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32698300/