We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dao.insertLinks(food,"pets");
如果 food.id 的值为 6,那么上述操作实际上会执行: 循环 food.pets 执行执行 SQL 获取 最大值: SELECT MAX(id) FROM t_pet // 假设返回的值是 97 执行 SQL 插入关联: INSERT INTO t_pet_food (foodid, petid) VALUES(6, 97); ...看,并不会插入 food 对象。
事实上,在多对多关系中,应该使用: dao.insertRelation(food,"pets"); 这样不需要产生: INSERT INTO t_pet (name) VALUES("XiaoBai"); 只需要插入中间表记录: INSERT INTO t_pet_food (foodid, petid) ;
The text was updated successfully, but these errors were encountered:
fixed issue #59
78f5259
楼上的错了,那个是给 #50 的提交
Sorry, something went wrong.
e1c0c16
No branches or pull requests
原wiki这样写道:
dao.insertLinks(food,"pets");
如果 food.id 的值为 6,那么上述操作实际上会执行:
循环 food.pets 执行执行 SQL 获取 最大值: SELECT MAX(id) FROM t_pet // 假设返回的值是 97
执行 SQL 插入关联: INSERT INTO t_pet_food (foodid, petid) VALUES(6, 97);
...看,并不会插入 food 对象。
事实上,在多对多关系中,应该使用:
dao.insertRelation(food,"pets");
这样不需要产生:
INSERT INTO t_pet (name) VALUES("XiaoBai");
只需要插入中间表记录:
INSERT INTO t_pet_food (foodid, petid) ;
The text was updated successfully, but these errors were encountered: