I’m at chapter 5 and feel like nothing’s explained.
-
CachedAnimalWithDetailsis in a relationship withCachedVideoandCachedPhotoin an1:Nrelationship. So we createCachedAnimalAggregatewhere we have one animal and a list of videos and photos. ButCachedOrganizationis also in a relationship withCachedAnimalWithDetailsin1:Nyet we don’t create an aggregate class. Why? -
CachedVideoandCachedPhotohave a foreign key,CachedAnimalWithDetails.animalId. We annotate the class as such and the data class also has a propertyval animalId: Long. However,CachedAnimalWithDetailsalso has a foreign key,CachedOrganization.organizationIdyet this time, we only annotate the class and the data class doesn’t have anyorganizationIdproperty. Why? -
Page 97, there’s a code snippet of
CachedAnimalAggregateand then the explanations:
In this code you used:
- @Embedded for the animal property of type CachedAnimalWithDetails
- @Relation for the photos and videos properties of type List and List respectively…
Are you folks serious? Not only did you not explain anything (why or what those annotations do), you literally described what I’ve already done. That’s like saying “you calculated 1 + 1 = 2 because one plus one is two”. It’s not only zero value information, it’s literally negative value information.