我正在尝试将数据插入到两个具有关系的不同表中。例如student和hobby。所以student->hasOne(hobby)和hobby->belongsTo(student)。我把所有这些信息一气呵成地插入到一个表单中,供你在做类似的事情时参考:one form submision to 2 controllers in laravel。现在我的问题是如何保存与学生id相同的业余爱好?如果我先保存student,然后再保存另一个表单来保存hobby,那么
Data是一个表,它有一个名为id的自动增量主键,定义为def id = column[Long] ("id", O NotNull, O PrimaryKey, O AutoInc, O DBType我使用Data.insert(name, filename)创建一个新的Data记录。有没有办法获得刚刚创建的记录的id?insert方法仅返回executeUpdate返回<em