Hi,
I have three entities, User, Role and Access.
User has many-to-many association to Role.
Role has many-to-many association to Access.
I want to make query that fetches data from all three tables, but I don't want to set association property 'lazy' to false in mapping file, because I don't want fetch all information every time.
This code already fetches users with roles
Code:
Criteria crit = session.createCriteria( UserBean.class );
crit.add( Expression.eq("username", username) );
crit.setFetchMode( "roles", FetchMode.EAGER );
List users = crit.list();
How can I make it to fetch Access also?
Hibernate version:2.1
Thank you