Hello folks, happy Friday. Question: is it possibl...
# room
c
Hello folks, happy Friday. Question: is it possible for a Room db entity to have a field that is a
value class
? For example:
Copy code
@Entity
data class Order(id: OrderId)

@JvmInline
value class OrderId(val value: String)
When I do this, I get an error at build time:
Copy code
Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
Another error says:
Copy code
Cannot find getter for field.
I am using Room v2.3.0 Thanks for any help!
I’ve been informed there’s an issue for this: https://issuetracker.google.com/issues/124624218
y
FYI the current plan is to support this when we support generating kotlin code which is in the 21-22 planning (so not anytime soon but in the pipeline, finally)