OrmLite: Unable to run insert stmt on object && ormlite does not have an id field

在用OrmLite操作數據的create或update的時候,即調用createOrUpdate函數,發現數據庫會報錯,內容如下: 「Unable to run insert stmt on object xxxx」,插入失敗。 通過閱讀源碼,發現createOrUpdate並未走到update流程,而是走到create流程: 因爲我們傳入的data的id一直都是0,因爲我們設置了data中的id
相關文章
相關標籤/搜索