Deep dtos/entities make the structure of a program very complicated and confusing. A better solution would be to use only flat objects, which store the attributes of the entity (e.g. a profile only has a id, a name, printEnabled, filterEnabled, greenscreenEnabled and a watermark but no list of background categories). The related entities can then be accessed through service methods such as getBackgroundCategoriesForProfile, which themselves call a seperate dao, which is only responsible for storing the relation.
Deep dtos/entities make the structure of a program very complicated and confusing. A better solution would be to use only flat objects, which store the attributes of the entity (e.g. a profile only has a id, a name, printEnabled, filterEnabled, greenscreenEnabled and a watermark but no list of background categories). The related entities can then be accessed through service methods such as getBackgroundCategoriesForProfile, which themselves call a seperate dao, which is only responsible for storing the relation.