首页>代码>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日