1. 程式人生 > >GreenDao 3.0 出現 UNIQUE constraint failed

GreenDao 3.0 出現 UNIQUE constraint failed

insert的時候id出現重複。

查到解決辦法

http://stackoverflow.com/questions/34980137/unique-constraint-failed-sqlite-database-android

@Id
private long schedule_id;

於是加上(autoincrement=true)

還是不行,發現是要用Long物件

@Id(autoincrement = true)
private Long schedule_id;
這樣才解決。。

相關推薦

GreenDao 3.0 出現 UNIQUE constraint failed

insert的時候id出現重複。 查到解決辦法 http://stackoverflow.com/questions/34980137/unique-constraint-failed-sqlite-database-android @Id private long sc

greendao 3.0版本踩坑

最近公司專案需要使用greendao儲存本地資料庫 遇到了一些問題記錄一下,主要是一對多表關聯查不出子表資料問題。 greendao使用相信大家網上一搜大量教你試用文章所以前面就不記錄了。 貼幾個標籤 @Id 標明主鍵 @NotNull 非空 @Unique 新增唯

已解決 Gradle 3 0 出現問題

                使用Gradle3.0的時候報錯: Gradle sync failed: Cause: org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to

greendao 3.0整合和使用封裝

現在專案中要用到資料庫,最終選擇使用了greendao ,至於原因,肯定是效能原因了。本文將著重介紹資料庫的非同步操作,因為網上很多都是配置整合+簡單的使用,並且都還是同步的(重要的是 都是一樣的文章!!!)。我想說,如果是百萬級的資料就GG了。 一般來說,我

GreenDAO 3.0 資料庫整合,使用,升級

import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.suppo

GreenDao 3.0使用詳解

使用步驟: 1.module的build.gradle新增: apply plugin: 'org.greenrobot.greendao'//新增 2.module的build.gradle依賴新增: compile'org.greenrobot:greenda

rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm出現error: open of vsftpd-3.0.2-22.el7.x86_64.rpm failed: No such file or directory的解決方法

   情況一: 出現如圖問題, 我當時的問題是通過安裝rpmbuild工具軟體解決的 以前製作rpm時,沒有遇到過這個問題,幾經搜尋也沒有解決。後來發現當前的centos沒有安裝 rpmbuild 工具軟體。以前的系統安裝了,索性就安裝了 rpmbuild軟體  

Android studio 3.0 引起的 outputFile sync failed:not vaild

-m .apk through version 3.0 put 官網 我們 ready 我們大多使用 android studio 改變生成安裝包命名會用以下方式: applicationVariants.all { variant -> vari

Cocos2d 3.0繼承自Sprite的類在addChild後出現故障

sdn s2d 調用 技術 b2c 技術分享 http track ddc 當繼承自Sprite的類被addChild到其它的Node裏後出現例如以下圖問題,說明沒有調用父類Sprite::init()的方法,由於父類Sprite裏的_textureAtlas須要初始化

在web.xml中加了servlet配置之後出現Server Tomcat v7.0 Server at localhost failed to start.

這裡轉載一位博主的文,寫的很好。 先貼連結:https://www.cnblogs.com/vivizhang/p/vivizhang.html 總結下,用ecplise生成的servlet會自動生成一個註解,比如:@WebServlet("/ServletDemo") 如果,我們還去w

android studio 3.0 升級後突然Error:(26, 13) Failed to resolve: com.squareup.picasso:picasso:2.5.2的問題

在今天因為要適配android 8.0的桌面圖示,所以升級了android studio到3.0,升級後就遇到了很多問題,要你升級開發gradle等等,這都還好,突然報了Failed to resolve這個錯誤,真的要命,就是下載不了第三方的元件,然後一直找找找,最後在build.gardle裡面

Selenium 3.0.1 出現的問題以及解決

3.0.1 更新以後,需要做兩個操作: Geckodriver executable needs to be in PATH。Geckodirver的下載地址:https://github.com/mozilla/geckodriver/releases 報錯內容: WebDriv

Android Studio 升級到3.0出現編譯錯誤Error:Cannot choose between the following configurations of project

前段時間將Android Studio 升級到3.0後,原本一切正常的專案出現編譯錯誤 Error:Cannot choose between the following configurations of project :**:  - debugApiElements 

PHP 7.X安裝Zabbix 3.0.7出現問題解決

A non well formed numeric value encountered [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → i

Android7.0編譯出現問題(Failed to contact Jack server)

Android N,O在初始原始碼編譯時,很多會出現Failed to contact Jack server: Problem reading .jack-server/client.pem. Try 'jack-diagnose' 這種報錯的情況。解決辦法如下: 一、 .jack-s

使用Android Studio 3.0開啟專案報錯:Gradle 'XXX專案' project refresh failed

今天使用Android Studio 3.0開啟一個老專案時,報使用的gradle版本不支援這個方法,出現如下錯誤: Error:Unsupported method: BaseConfig.getApplicationIdSuffix(). The versi

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources

遇見一個很奇怪的問題,專案能正常執行,但是install和打包不成功,後來在網上找了很久解決方案才解決。 原部落格地址:https://blog.csdn.net/w19980426/article/details/81275461 1.進入本地倉庫的repository\org\apach

導專案出現Upgrade plugin to version 3.0.0-alpha1 and sync project

下面這一段是出錯資訊 Error:(1, 0) The android gradle plugin version 3.0.0-alpha1 is too old, please update to the latest version. To override this check fro

Pip 更新Spyder至3.3.0出現的問題

用pip安裝whl檔案來更新Spyder至3.3.0時出現:Cannot uninstall 'spyder'. It is a distutils installed project and thus we cannot accurately determine which

Android Studio 3.0整合ButterKnife8.8.1版本出現問題以及解決方法

      新安裝了Android Studio 3.0 ,做專案的時候需要整合ButterKnife,去githd上一看ButterKnife升級到了8.8.1,按著用法整合到了專案中,but 出現了下面的錯誤:Error:(2, 0) Android Gradle plu