首页>代码>spring boot+springdata jpa的项目整合demo例子>/demo_jpa/src/main/java/com/example/demo/controller/HelloController.java
package com.example.demo.controller;

import com.example.demo.model.Emp;
import com.example.demo.service.IEmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by caiqibin on 18/3/14.
 */
@RestController
public class HelloController {

    @Autowired
    private IEmpService empService;

    @RequestMapping("/queryEmpAll")
    public List queryEmpAll() {
        List<Emp> empList=empService.queryAll();
        for(Emp emp : empList) {
            System.out.println(emp.getEname());
        }
        return null;
    }
}
最近下载更多
Uless  LV2 2021年9月17日
shiopaaa  LV13 2021年8月19日
Charlie89  LV3 2021年2月27日
1272990168  LV2 2020年8月30日
wohefeng456  LV1 2020年8月14日
912299793  LV21 2020年5月15日
geekcjj  LV18 2020年4月4日
15558616361  LV8 2020年3月27日
sunqiuxiang  LV2 2020年3月8日
EMkiller  LV3 2020年2月25日
最近浏览更多
sixiongbin  LV8 2023年5月22日
xshxxm1  LV21 2023年3月21日
jaonsang  LV25 2022年10月8日
werqjkl  LV5 2022年9月30日
-伪--善-  LV3 2022年5月29日
221231 2022年5月18日
暂无贡献等级
小肥鸟 2022年5月18日
暂无贡献等级
fengshengtian  LV8 2022年2月26日
zy_286315  LV7 2021年12月27日
wang512237140  LV20 2021年12月12日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友