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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With