greenDAO
greenDAO copied to clipboard
How does Greendao's insertOrReplace method avoid changing the corresponding value in the database when some filelds of the object are null?
当对象的一些属性为null时,greendao的insertOrReplace方法怎么避免修改数据库里对应的值? EN:How does Greendao's insertOrReplace method avoid changing the corresponding value in the database when some filelds of the object are null?
This is the SQLite command used: https://github.com/greenrobot/greenDAO/blob/0cce6c004181eeec9b900c9bd2ef47d7f0c23893/DaoCore/src/main/java/org/greenrobot/greendao/internal/TableStatements.java#L67
According to https://www.sqlite.org/lang_conflict.html this means if an entity/row with this key exists, it will be deleted first before the given entity/row is inserted.