GreenDAO - primary key on multiple columns

Does GreenDAO support primary key across multiple columns?

I use the method Property primaryKey()for two columns, but it does not work. I get an exception:

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

How to create a primary key on multiple columns? Should I edit the created DAO classes?

+5
source share
1 answer

The documentation says:

Entities should currently have the long or Long property as their primary key. [...] To get around this problem, you can use a long primary key and use a unique index for the proposed key properties.

+6

All Articles