talent85012016
2016-12-15 18:39
@Test
public void testGetStudents(){
Students s = (Students) session.get(Students.class, 1);
System.out.println(s.getClass().getName());
}
public void testLoadStudents(){
Students s = (Students) session.load(Students.class, 1);
System.out.println(s);
}
public void testUpdateStudents(){
Students s = (Students) session.get(Students.class, 1);
s.setGender("女");
session.update(s);
}
public void testDeleteStudents(){
Students s = (Students) session.get(Students.class, 1);
session.delete(s);
}
添加注解@Test试一下
报错截图上来啊
你有没有设置主外键关联啊?
Hibernate初探之单表映射
74810 学习 · 793 问题
相似问题
回答 1
回答 2