I\'m converting a project to Kotlin and I\'m trying to make my model (which is also my entity) a data class I intend to use Moshi to convert the JSON responses from the API<
https://issuetracker.google.com/issues/62851733
i found this is @Relation's projection bug! not Kotlin language problem. based google GithubBrowserSample java also happend error, but different error message.
below is my kotlin code:
data class UserWithCommunities(
@Embedded
var user: User = User(0, null),
@Relation(parentColumn = "id",
entityColumn = "users_id",
entity = CommunityUsers::class,
projection = arrayOf("communities_id")) // delete this line.
var communityIds: List = emptyList()
)
right:
data class UserWithCommunities(
@Embedded
var user: User = User(0, null),
@Relation(parentColumn = "id",
entityColumn = "users_id",
entity = CommunityUsers::class)
var communityList: List = emptyList()
)