Is it possible to share models with a backend modu...
# android
s
Is it possible to share models with a backend module with room? I have a common module with all my models and I want to use those models to save data to sqlite in my app module
I'm pretty sure it's impossible. Just wanted to make sure there isn't a piece of kotlin magic that I've missed
d
It shouldn't be impossible. You'll just have to figure out how to handle annotations I think.
s
Yes. Annotations are why it is impossible. That and the fact that data classes are strictly final
d
You could typealias the annotations on the other platforms.
s
yeah it could work actually. There is also an artifact "room-common" with all the annotations and almost nothing else. I haven't been able to test it completely yet but things look good. Thank you :)