2012-09-12 52 views

回答

2

从DataStore类的javadoc。旧版本可能无法使用。即使这我认为是内部迭代并一次保存一个 - 但它可能会得到优化,所以最好使用它而不是迭代自己。

<T> Iterable<Key<T>> 
save(Iterable<T> entities) 
      Saves the entities (Objects) and updates the @Id field 
<T> Iterable<Key<T>> 
save(Iterable<T> entities, com.mongodb.WriteConcern wc) 
      Saves the entities (Objects) and updates the @Id field, with the WriteConcern 
<T> Iterable<Key<T>> 
save(T... entities) 
      Saves the entities (Objects) and updates the @Id field 

http://morphia.googlecode.com/svn/site/morphia/apidocs/com/google/code/morphia/Datastore.html#save(java.lang.Iterable

相关问题