小编use*_*599的帖子

错误:org.hibernate.hql.internal.ast.QuerySyntaxException:未映射网站

我正在尝试使用restful web services创建项目.我收到了一个错误

org.hibernate.hql.internal.ast.QuerySyntaxException:未映射网站

.我已经尝试了每个解决方案来解决这个错误.请查看我的代码并告诉我是否有任何建议.谢谢你

GifController:

  package com.gif.code.controller;

  import java.util.List;

  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;

  import com.gif.code.model.GifModel;
  import com.gif.code.service.GifService;

  @RestController
  public class GifController {

    @Autowired
    GifService gifService;

    @RequestMapping(value = "/getAllData", method = RequestMethod.GET,  headers = "Accept=application/json")
    public List<GifModel> getData() {
        System.out.println("In Controller");
        List<GifModel> listOfData = gifService.getAllData();
        return listOfData;
    }

    @RequestMapping(value = "/getData/{id}", method = RequestMethod.GET, headers = "Accept=application/json")
    public GifModel getDataById(@PathVariable int id) {
        return gifService.getData(id);
    }

    @RequestMapping(value = "/addData", method = RequestMethod.POST, …
Run Code Online (Sandbox Code Playgroud)

java spring web-services hibernate maven

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

标签 统计

hibernate ×1

java ×1

maven ×1

spring ×1

web-services ×1