https://kotlinlang.org logo
#android
Title
# android
j

Joan Colmenero

07/07/2019, 9:23 AM
Just posted a question about room in stackoverflow, it's about an M:N relationship, if you know or have worked with it, please ping me, I'm seeing that I'm almost done but I need my last clarification. Thanks!
d

Dominaezzz

07/07/2019, 9:24 AM
Link?
j

Joan Colmenero

07/07/2019, 10:09 AM
Send it to you
d

Dominaezzz

07/07/2019, 10:38 AM
Haven't used Room in a while. Not sure if M:N is now supported. You may have to manually write the query.
I ask for the link so other people could easily look it up.
j

Joan Colmenero

07/07/2019, 11:04 AM
Easier question then, I have inside my Entity an object that is a List<String> so I need to do a query to check if X is inside that list, how can I do it?
d

Dominaezzz

07/07/2019, 11:11 AM
The version of sqlite shipped with android can't handle surgical queries on a column. You'll have to move that list into another table and do JOINs and WHEREs.
j

Joan Colmenero

07/07/2019, 11:27 AM
i'm usin room
d

Dominaezzz

07/07/2019, 11:28 AM
Which uses sqlite underneath.
j

Joan Colmenero

07/07/2019, 11:32 AM
Then how can I do the query to that list?
d

Dominaezzz

07/07/2019, 11:35 AM
Look at Option #1 of the voted answer.