QueryDSL over collections -> any() 用于字符串列表
QueryDSL over collections -> any() for a List of Strings
我正在尝试对集合使用 querydsl。
我的列表是 List<String>
.
第一个问题,是否可以在 primitive 类型集合上使用 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();
我正在尝试对集合使用 querydsl。
我的列表是 List<String>
.
第一个问题,是否可以在 primitive 类型集合上使用 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();