Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JPA CriteriaBuilder在给定时间段内获取更大的日期值_Jpa_Criteria Api - Fatal编程技术网

JPA CriteriaBuilder在给定时间段内获取更大的日期值

JPA CriteriaBuilder在给定时间段内获取更大的日期值,jpa,criteria-api,Jpa,Criteria Api,我用 ge()获取大于给定时间段的值,但获取编译问题状态时出现以下错误 The method ge(Expression<? extends Number>, Expression<? extends Number>) in the type CriteriaBuilder is not applicable for the arguments (Path, ParameterExpression<capture#6-of ? extends LocalDateTi

我用 ge()获取大于给定时间段的值,但获取编译问题状态时出现以下错误

The method ge(Expression<? extends Number>, Expression<? extends Number>) in the type CriteriaBuilder is not applicable for the arguments (Path, ParameterExpression<capture#6-of ? extends LocalDateTime>)

方法ge(Expressionge()适用于数字。使用greaterThanOrEqual()@JBNizet谢谢ge()适用于数字。使用greaterThanOrEqual()@JBNizet谢谢
  public Crud<T> greaterDate(String property, String value) {

    CriteriaBuilder cb = getCriteriaBuilder();
    CriteriaQuery<T> cq = cb.createQuery(getEntityClass());
    Root<T> root = cq.from(getEntityClass());
    ParameterExpression<? extends LocalDateTime> expression = cb.parameter(LocalDateTime.class);

    cq.select(root);


    Predicate predicate = cb.ge(root.get(getEntityType().getSingularAttribute(property)), expression);