实体类中:
@ManyToOne(targetEntity
= Classes
.class)
@JoinColumn(name
= "scid",referencedColumnName
= "cid",insertable
= false,updatable
= false)
private Classes classes
;
控制器:直接使用jpa中的findAll方法
@RequestMapping("/findAll")
public List
<Student> findAll(){
return studentService
.findAll();
}
postman请求:
转载请注明原文地址:https://blackberry.8miu.com/read-1710.html