Salat DAO中如何封装SalatMongoCurser?
How to encapsulate SalatMongoCurser in Salat DAO?
Here a solution is explained on how to encapsulate database specific MongoDBObject
when making a call to a salat DAO method. Now if I use the find
method that returns a SalatMongoCursor
, my code will again be dependent on the specific database. I see Here 将光标更改为列表不利于性能。有更好的出路吗?
到目前为止,我的问题没有收到任何回复,我得出的结论是 "No"。就我个人而言,我决定转换成List,因为无论如何我以后都需要遍历它。
Here a solution is explained on how to encapsulate database specific MongoDBObject
when making a call to a salat DAO method. Now if I use the find
method that returns a SalatMongoCursor
, my code will again be dependent on the specific database. I see Here 将光标更改为列表不利于性能。有更好的出路吗?
到目前为止,我的问题没有收到任何回复,我得出的结论是 "No"。就我个人而言,我决定转换成List,因为无论如何我以后都需要遍历它。