Compare Date entities in JPA Criteria API

前端 未结 4 854
离开以前
离开以前 2020-12-03 00:20

Using JPA 2 with EclipseLink implementation.

I\'m trying to build a dynamic query which should bring me some records persisted after a given date.



        
4条回答
  •  星月不相逢
    2020-12-03 01:15

    I was getting a similar error but with the syntax predicates.add(cb.greaterThan(article.get(Article_.created), since)); and found this page. The cause for me, turned out to be that I had upgraded my project from Java 1.7 to 1.8, and in the process had configured Maven to compile for Java 1.8 as well. I simply had to change Maven compiles back to 1.7, while keeping the rest of the project at 1.8, to fix the error.

提交回复
热议问题