Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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
Spring boot 用于比较日期的Spring Boot JPA规范_Spring Boot_Jpa_Spring Data Jpa_Predicate_Criteria Api - Fatal编程技术网

Spring boot 用于比较日期的Spring Boot JPA规范

Spring boot 用于比较日期的Spring Boot JPA规范,spring-boot,jpa,spring-data-jpa,predicate,criteria-api,Spring Boot,Jpa,Spring Data Jpa,Predicate,Criteria Api,我需要找到在用户传递的日期之间的表记录。我正试图为此编写一个规范,但它向我显示编译时错误,如下所示: The method between(Expression<? extends Y>, Expression<? extends Y>, Expression<? extends Y>) in the type CriteriaBuilder is not applicable for the arguments (Expression<Date&g

我需要找到在用户传递的日期之间的表记录。我正试图为此编写一个规范,但它向我显示编译时错误,如下所示:

The method between(Expression<? extends Y>, Expression<? extends Y>, Expression<? extends Y>) 
in the type CriteriaBuilder 
is not applicable for the arguments (Expression<Date>, Object, Object)
从存储库中提取记录的服务

if(!Utility.isNull(Id)){
                idSpec = new ScheduleClassSpecification(new SearchCriteria("Student",":",Id));
            }

            Page<SCOutput>  listreturn = scRepo.findAll(Specification.where(idSpec), SCOutput.class,new PageRequest(0, 100));
if(!Utility.isNull(Id)){
idSpec=新的ScheduleClassSpecification(新的搜索条件(“学生”,“学生”,“学生:”Id));
}
Page listreturn=scRepo.findAll(Specification.where(idSpec),SCOutput.class,new PageRequest(01100));

编译器错误告诉您需要一个
表达式


通过将
criteria.getValue()
替换为可以很容易地做到这一点。您可以尝试将
criteria.getValue()
键入到
Date
吗?
public class SearchCriteria {
    private String key;
    private String operation;
    private Object value;}
if(!Utility.isNull(Id)){
                idSpec = new ScheduleClassSpecification(new SearchCriteria("Student",":",Id));
            }

            Page<SCOutput>  listreturn = scRepo.findAll(Specification.where(idSpec), SCOutput.class,new PageRequest(0, 100));