Hello Manuel!
I decided to have a DAO for the abstract Entity so that I can perform operations common to all entities such as for instance something like this:
Code:
@Modifying
@Transactional
@Query("UPDATE Advertisement a SET a.advertisementActivated = false WHERE a.account.accountID = ?1")
def deactivateAdvertisementsFromAccountID(accountID: Integer): Int
So that adds up to a total of 7 DAOs just to deal with the concepts of Advertisements and Accounts...
Regarding the first part of your reply, are you basically saying that it is OK to have that many DAOs?
I am not sure I understand what you said about low coupling and high cohesion. On which side is my current design tipped?
Regards,
Julien.

Originally Posted by
dr_pompeii
Hello
Is normal that Each Entity should has its own DAO class to handle the persistence or CRUD operations.
Could be nice only has the AdvertisementDAO class to work with ChildminderAdvertisement, ParentToChildminderAdvertisement, ParentToParentAdvertisement. Same case for Account. The problem is that if for each entity has a lot of CRUD operations (making the class verbose), and you must discriminate what subclass you want to manipulate.
Why 4? If you only has three concrete classes ChildminderAdvertisement, ParentToChildminderAdvertisement, ParentToParentAdvertisement. Advertisement is an abstract class
Is relative, you have here the dilemma about low coupling and high cohesion