I am using greendao to support SQL database on Android. Now I am faced with the problem of creating an object with two columns as a primary key. To be clear, I have column1 and column2, both of which are long values ββand together form the primary key.
I tried to simulate it as
@Index(unique = true) private Long column1, column2
but it does not work. I get a unique constraint when trying to insert, and when trying to insertOrReplace it just gets replaced based on the identifier column1.
horin source share