How to Save Complex Objects In a Room DB 🙌

preview_player
Показать описание
Follow for more Android & Kotlin tips 🙌
Рекомендации по теме
Комментарии
Автор

if your data class is simple you can annotate the variable with @Embedded it would simply create columns with all the fields of that data class, but again if it is really a complex data class then type converters would be the correct way to save

bharathv
Автор

Thanks. I also extended it for T type and it now can use for custom types

officialnatig
Автор

A notion tutorial will be appreciated 🙂.

mymobile
Автор

Thanks for sharing. Need more videos like this.

SatishKanaujiyaeb
Автор

Thank you for sharing Philipp it is helpful.

rpitpatel
Автор

@Embedded can be used from androidx library this converter factory will make our code boilerplate& consider a case where we have to much object it will make life hell. Btw @philipp is rockstar of android 😊

parbinduu
Автор

How about Embedded and Relation!? Have forgotten how to use it. But had used it to save nested objects.

akshayprabhu
Автор

But what about saving objects or list of objects in Ktor using Exposed?

purplehazer
Автор

Can we convert complex objects into json string using GSON library and store it in database?

skillpolice
Автор

What if the String is more than 255 symbols? Will Room handle it?

ruslan
Автор

Is this the same for when you are converting a URI?

ast
Автор

Is there extra steps with di frameworks like hilt?

sercan
Автор

In object oriented programming, I don't implement anything..what I do is inherits or instantiate

orangasli