Jun 26 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 26 | 7:30 PM |
Ahmad M. | has entered the room |
Mark M. |
hello, Ahmad!
|
Mark M. |
how can I help you today?
|
Ahmad M. |
hello MR.Mark
|
Mark M. |
do you have a question?
|
Ahmad M. |
in the @Embedded section can i embedded a Location object in the database ?
|
Ahmad M. |
in Room database
|
Ahmad M. |
the Location from android.location.Location
|
Mark M. |
probably not
|
Mark M. |
that is not your class
|
Mark M. |
and you do not know what its fields are
|
Mark M. |
you do not know if those fields will change in an Android OS version update
|
Mark M. |
you are welcome to create your own class that captures the relevant bits of data (latitude, longitude, etc.) and use that with @Embedded
|
Jun 26 | 7:35 PM |
Mark M. |
but I would not try to embed a class that is not yours, unless it is specifically documented to be supported that way
|
Ahmad M. |
ok it's clear
|
Ahmad M. |
in @Transaction what we mean about that and what we use it for ?
|
Ahmad M. |
i can't uderstand what it's do for Room
|
Mark M. |
I cover that in "Android's Architecture Components"
|
Mark M. |
see page 42 of Version 0.9
|
Mark M. |
View paste
|
Ahmad M. |
yes you rghit but the genral idea i can't understand it
|
Mark M. |
you can put it on a custom method on your DAO that makes multiple other DAO calls, such as inserting a parent and several children in one transaction
|
Jun 26 | 7:40 PM |
Ahmad M. |
ok
|
Mark M. |
View paste
|
Mark M. |
here, insert() not only inserts an Invoice entity, but also the InvoiceLineItem entities that are children of the Invoice (1:N relationship)
|
Mark M. |
this way, the Invoice and all of the InvoiceLineItem objects will be stored in a transaction, so either it all gets stored, or none of it gets stored
|
Mark M. |
you do not wind up in a case where part of the data is stored successfully and the rest is not
|
Mark M. |
there are some other scenarios in the book (pages 42-44 of Version 0.9)
|
Ahmad M. |
ok i thenk it's clear now
|
Ahmad M. |
*think
|
Jun 26 | 7:45 PM |
Ahmad M. |
what is Instrumentation Tests?
|
Mark M. |
those are the tests that you put in androidTest/, that run on the Android device
|
Mark M. |
they are covered in "The Busy Coder's Guide to Android Development", starting in the chapter on JUnit4
|
Mark M. |
see page 1011 of Version 8.12
|
Ahmad M. |
yes, forgave me i'm confuse about it
|
Jun 26 | 7:50 PM |
Mark M. |
if you have specific questions, I can try to answer them, but I recommend that you read the chapters first, if you have not done so already
|
Jun 26 | 7:50 PM |
Ahmad M. |
thank you very much Mr.Mark i don't have a question.
|
Jun 26 | 8:05 PM |
Ahmad M. |
hello Mark
|
Mark M. |
hello!
|
Ahmad M. |
are you there ?
|
Mark M. |
yes
|
Mark M. |
you have not asked a question
|
Mark M. |
the last entry in the chat that I see from you is "i don't have a question"
|
Mark M. |
if you asked something after that, the chat room lost it -- could you ask again?
|
Ahmad M. |
View paste
|
Mark M. |
ExtracteLocation should work with @Embedded, if that is what you are asking
|
Ahmad M. |
yse can i Embedded this in the Entity calss
|
Mark M. |
that should work fine
|
Ahmad M. |
ok thank you very much i realy don't have any more questions.
|
Mark M. |
OK
|
Jun 26 | 8:30 PM |
Mark M. |
that is a wrap for today's chat
|
Mark M. |
the transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Thursday at 9am US Eastern
|
Mark M. |
have a pleasant day!
|
Ahmad M. | has left the room |
Mark M. | turned off guest access |