For example, if I have two tables: Customer
and Product
and I need to map customers to products (many-to-many). So I need a third (join) table, which will contain CustomerId
and ProductId
. Is DAO
responsible for inserting records into the third (join) table?
P.S. For now I have CustomerDAO
and ProductDAO
. Mapping customers to products handled by a service-layer.
Yes, your DAO can implement methods like
Yes of course, it is its responsibility. If not DAO
, then who will do it instead of it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With