I’m currently on learning on using Dao pattern in my project. I know, one Table is equivalent to one Dao, am I right? just like StudentDao, SubjectDao.
Each Dao performs CRUD operations in their associated tables, but my question is, how am I going to create a DAO for joined tables? lets say I have a query to join student and subject table, then how do I create a DAOfor that?
Should I place it to the StudentDao? or to SubjectDao? or there’s a good practice in that kind of situation?
DAO - Data Access ObjectisObjectthat should only communicate with database. So if you want toJOINtwo tables so you must have in yourDTO ObjectStudentDTO reference onSubjectDTO.So, SubjectDTO
And
DAOcan look like this:I recommend to you check some tutorials.
Regards