You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
I'm going to take a Patient->>Study->>Series->>Image model that is
similar to the Blog->>Post->>Comment model in the usual Ayende
example.
The mapping is as follows:
Now with these wonderful models in mind -
I actually need to query a list of PATIENTS but by providing Patient/
Study/Series/Image search parameters.
Largely not a big problem since each CAN be created separately as a
DetachedCriteria and connected via subqueries.
The problem though is - How do I sort the list of PATIENTS I get by
the StudyDate????
If I try to create a study criteria FROM the Patient criteria ->
patientCriteria.CreateCriteria("StudyList",JoinType.InnerJoin) -
this CAN give me capability by sort by studyDate on Patients (due to
the join) ...
BUT - due to the Many-to-one mapping from Study to Patient it does
ANOTHER join back from Study to Patient!
1) How do I avoid this?
2) How do I avoid a Cartesian product?
3) as an addendum - what is the best way to grab this entire tree out
of the DB without cascading into a whole boatload of N+1 SQL
queries???