本文介绍了ORM概念的一些问题....你怎么看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 对于我搜索过的所有ORM,我总是发现两个大问题: 1)要更新或删除一组记录,必须先将它带到内存中。 如果你在一个循环中并且必须做n次,那么你必须查询 这个设置n次。如果ORM可以更容易(以 强类型方式)调用动态查询来直接更新/删除 记录,那就太好了。 2)我注意到所有ORM都使用集合作为 查询的返回数据类型。那么,你不能添加,删除,替换或重新排序这个 集合中的元素......这限制了你工作的方式很多,特别是如果你是 在循环中迭代并且必须对同一个表进行更改 迭代... 您对此有何看法?For all the ORM i have searched around, I have always found two big problems:1) To update or delete a set of records you must first bring it to memory.If you are inside a loop and have to do it n times, then you have to querythis set n times as well. Would be nice if ORM could make it easier (in astrongly type manner) to call a dynamic query to directly update/deleterecords.2) I have noticed all ORM work with collection as thei return datatype of aquery. Well, you cannot add, delete, replace, or reorder the elements in thiscollection...this restrict a lot the way you can work, specially if you areiterating in a loop and have to make changes to the same table you areiterating...What are your opinions about it ?推荐答案 不,Hibernate(至少Java版本)*不必*获取 记录以更新/删除它们。 参见 http://www.hibernate .org / hib_docs / v3 ... tch.html#batch -direct 又名 http://tinyurl.com/4kpug 并向下滚动到DML风格的操作。 - Jon Skeet - < sk *** @ pobox.com> http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet 如果回复该组,请不要给我发邮件No, Hibernate (at least the Java version) does *not* have to fetchrecords in order to update/delete them.See http://www.hibernate.org/hib_docs/v3...tch.html#batch-directaka http://tinyurl.com/4kpugand scroll down to "DML-style operations".--Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeetIf replying to the group, please do not mail me too 这篇关于ORM概念的一些问题....你怎么看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-21 19:20