You should precise your needs if you want to get a better answer.
With the criteria API, you have to create the criteria object defining a root class, this way :
Code:
Criteria crit = session.createCriteria(YourEntity.class);
Then, use the names of the properties in te YourEntity class to build your query. For example :
Code:
crit.setFetchMode("someCollection", FetchMode.JOIN);
would override the lazy-loading mode for the someCollection collection.
Code:
crit.createCriteria("role")
would create what is called a "subcriteria".
Then use the add() method with the criterion you want and your query should be ok :-).