In my project we have hbm.xml file which is fetch="select" for one-to-many for all relation tables.
For ex: One school is having many classrooms and one classroom will have many children
so in my hbm file
school.hbm.xml
<set name="classrooms" lazy="false" fetch="select">
classroom.hbm.xml
<set name="children" lazy="false" fetch="select">
There is a case where I want to fetch only list of schools which are based on classroom div = 'A'. But because of this mapping hibernate is doing select for classroom as well which I don't want in this case.
Please help me how can I avoid doing unnecessary select with classroom. Is there anyway to override this fetch mode and join only with School and classroom and not with children
I tried with multiple options but no luck. Really appreciate for your inputs.