code of entities 'employee' and 'timelog'问题: 我有两个表employee和timelog.Timelog与employee表(employee id)有外键关系。但是每个插入到timelog表的员工id都是null.Below是模型' employee'的代码片段。和' timelog'和逻辑。
@RequestMapping(path = "employee/{id}/timelog/tabdata",method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
public void timeLogging(@RequestBody ArrayList<TimeLogDto> tabData, @PathVariable("id") Integer id){
Employee e = employeeRepository.findOne(id);
tabData.forEach(log->{
e.addLog(timeLogRepository.save(log.createTimeLog()));
});
感谢任何帮助。