Saving Data on Android



Download 19,28 Mb.
Pdf ko'rish
bet137/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   133   134   135   136   137   138   139   140   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

Roms Entities
.
Crea/ng your rela/ons
As briefly mentioned in the previous chapter, you will only need to create one 
relationship between the entities in your app, and its ER diagram looks like this:
One to Many relation between Question and Answers
Why don't you use your recently acquired knowledge to guess which kind of 
relationship is this?
Well, if you said "a one to many relationship," you are correct.
With the above ER diagram, you are saying: "One question can have one or more 
answers and each answer can only be related to one and only one question". Just 
think about it and it makes a lot of sense since each question of the DroidQuiz app 
will have at least one correct answer and two incorrect answers. The beauty of this 
design is that you can easily expand it or modify it to have something like two 
correct answers and two incorrect answers or 3 correct answers and 2 incorrect 
answers... You get the point.
Now, you will see how easy it is to define foreign keys and one to many relationships 
between your Room entities. In fact, you can do it by adding a single line of code.
Open the 

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   133   134   135   136   137   138   139   140   ...   292




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish