I’m at chapter 5 and feel like nothing’s explained.
-
CachedAnimalWithDetails
is in a relationship withCachedVideo
andCachedPhoto
in an1:N
relationship. So we createCachedAnimalAggregate
where we have one animal and a list of videos and photos. ButCachedOrganization
is also in a relationship withCachedAnimalWithDetails
in1:N
yet we don’t create an aggregate class. Why? -
CachedVideo
andCachedPhoto
have a foreign key,CachedAnimalWithDetails.animalId
. We annotate the class as such and the data class also has a propertyval animalId: Long
. However,CachedAnimalWithDetails
also has a foreign key,CachedOrganization.organizationId
yet this time, we only annotate the class and the data class doesn’t have anyorganizationId
property. Why? -
Page 97, there’s a code snippet of
CachedAnimalAggregate
and 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.