I have been working on a project that implements a repository pattern. Basically it has the following structure:
Domain Objects <-- classes mapping database objects
Repositories implementing the IRepository or IGetOnlyRepository interface
DTO objects to communicate with the clients
I am involved in generating reports from the database. The reports are rather complex, and rely on data generated from stored procedures or execution of dynamic queries. I have noticed that so far in order to execute queries for the reports, the developers have used methods inside a given repository that execute queries against the database (using session.ExecuteQuery method of NHibernate).
However, queries executed are often combining multiple tables and for me they do not belong inside repositories. Can you suggest me a good practice as to where we can execute such queries?