Database ID
The mongoDB database is used in assignment 3. This database autogenerates a primary key id of type String. To date, using JPA, we have generated the id client-side. Here we discuss refactoring to adapt our app to a database where the id is autogenerated server-side.
Retrofit
A class may not implement more than one Callback. Yet in some compilation units the requirement is to use Callbacks where two or perhaps more response body types are used. An example would be the need to retrieve a list of residences and to delete a particular residence. Here we examine two patterns to deal with this situation: in one we use inner classes, in the other anonymous classes.
MyRent-16 (Mongo)
Allow the database to auto-generate the primary key (id). On creating a residence in the remote database, echo back the new record to inform the client of the id value. We demonstrate using a Play service, a JUnit test app and the MyRent Android client.