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).
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)