* 修复Excel导出导入数据
*@Author JueYue
*@date 2013-11-10
*/
private void repairExcel() {
CourseEntity course = new CourseEntity();
course.setName("海贼王");
TeacherEntity teacher = new TeacherEntity();
teacher.setName("路飞");
teacher.setPic("upload/Teacher/pic3345280233.PNG");
course.setTeacher(teacher);
List<StudentEntity> list = new ArrayList<StudentEntity>();
StudentEntity student = new StudentEntity();
student.setName("卓洛");
student.setSex("0");
list.add(student);
student = new StudentEntity();
student.setName("山治 ");
student.setSex("0");
list.add(student);
course.setStudents(list);
commonDao.save(course.getTeacher());
commonDao.save(course);
commonDao.save(course);
for (StudentEntity s :course.getStudents()){
s.setCourse(course);
}
commonDao.batchSave(course.getStudents());
}