当我尝试运行此查询选择长型变量:在Querydsl
Long count = ...;
List<CritereItem> items= new JPAQuery(entityManager).from(foo)
.list(new QCritereItem(foo.id, foo.name, count ));
我得到了编译错误,因为构造预计NumberPath<Long>
不Long
在可变count
,那么如何选择querydsl变量?
我通过更换计数构造:
Expressions.numberTemplate(Long.class, count.toString())
但我得到这个execption
java.lang.IllegalArgumentException: [email protected]
做到这一点请提供'CritereItem'的代码 – miensol