reset password
Author Message
munachiani
Posts: 1
Posted 11:06 Nov 21, 2018 |
  • Make sure the class has two constructors, one which takes in parameters to set all the fields, and one like the first except it doesn't take a parameter for, nor sets, the id field. Use @Ignore for the second constructor, so Room doesn't try to use it.

 

So the first constructor should have the id with other fields and the second constructor should have the other fields expect id?

maguil53
Posts: 5
Posted 00:22 Nov 22, 2018 |

Yes. The reasons why we should do this are explained in the Udacity course, Lesson 8 under "Exercise: Creating an Entity".