Room one-to-many warning

后端 未结 1 1675
悲哀的现实
悲哀的现实 2021-01-26 10:11

When creating my contact DAO and related classes, I am getting the following error:

The query returns some columns [mContactId, mAddress, mPostcode, mCity, mCoun         


        
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-26 10:46

    It's say very clear: You can use @ColumnInfo annotation on the fields to specify the mapping.

    Change your code like this:

    @NonNull
    @PrimaryKey
    @ColumnInfo(name = "id")
    private String id;
    

    More at codelab: https://codelabs.developers.google.com/codelabs/android-room-with-a-view/#0

    0 讨论(0)
提交回复
热议问题