を保存誰かがGreenDaoライブラリのメソッドinsert
、insertOrReplace
とsave
の違いは何である私に説明できますか?GreenDao、insertOrReplaceを挿入
私は、insert
が挿入するだけで、存在しない場合、または更新/置換が存在する場合は、insertOrReplace
挿入を理解します。
しかし、insertOrReplace
とsave
がどのように違うのですか? save
メソッドのコードを見てからAbstractDao.java
"Save 'saves' an entity to the database: depending on the existence of the key
property, it will be inserted (key is null) or updated (key is not null).
This is similar to insertOrReplace, but may be more efficient, because if
a key is present, it does not have to query if that key already exists."
ため
おかげ
** null **キーを持つエンティティではサポートされていません** insertOrReplace()** – htafoya
@htafoya https: //github.com/greenrobot/greenDAO/issues/534 –