小编Ada*_*ley的帖子

无法启动LiveReload服务器

我从spring-boot网站下载源代码演示代码,当我导入Intelj构思并启动应用程序时,控制台有一个WARN,它说

2017-08-14 12:23:23.609 WARN 2356 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : Unable to start LiveReload server

虽然应用程序正在运行,但我仍然想知道为什么它有这个警告!

spring-boot

11
推荐指数
2
解决办法
6209
查看次数

至少提供了 2 个参数,但按使用规范和排序查询时仅存在 1 个参数

在使用 JPA 接口时JpaSpecificationExecutor,我创建了以下代码,但它抛出错误:“至少提供了 2 个参数,但查询中仅存在 1 个参数”。

调用代码

@Override
public Result findSightsWithConditions(String cityId, Map<String, String> filter_map) {
  //scoreOrder priceOrder minScore maxScore minPrice maxPrice
  Specification<Sight> specification = new Specification<Sight>() {

    @Override
    public Predicate toPredicate(Root<Sight> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
      List<Predicate> predicates = Lists.newArrayList();
      //predicates.add(criteriaBuilder.equal(root.get("cityId"), cityId));
      if (null != filter_map.get("maxScore")) {
        double max = Integer.parseInt(filter_map.get("maxScore"));
        predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("score"), max));
      }
      if (null != filter_map.get("maxPrice")) {
        double max = Integer.parseInt(filter_map.get("maxPrice"));
        predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("price"), max));
      }
      if (null != filter_map.get("minScore")) {
        double min = Double.parseDouble(filter_map.get("minScore")); …
Run Code Online (Sandbox Code Playgroud)

java jpa spring-data-jpa spring-boot

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

spring-boot ×2

java ×1

jpa ×1

spring-data-jpa ×1