GreenDAO - primary key on multiple columns

转:http://stackoverflow.com/questions/15250609/greendao-primary-key-on-multiple-columns

Does GreenDAO support primary key on multiple columns?

I'm using Property's method primaryKey() on two columns but it doesn't work. I'm getting exception:

Caused by: android.database.sqlite.SQLiteException: table "table" has more than one primary key

How to create primary key on multiple columns? Should I edit generated DAO classes?

=======================================================================

The documentation says:

Currently, entities must have a long or Long property as their primary key. [...] To work around this issue, you can use a long primary key and use an unique index for the intended “key” properties.

posted on 2014-08-25 21:44  屁屁侠  阅读(1212)  评论(0编辑  收藏  举报

导航