Guest User

Untitled

a guest
Jun 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. string sql = "from Recipe r " +
  2. "left join fetch r.Images " +
  3. "inner join fetch r.User " +
  4. "where r.Completed!=0";
  5. IList<Recipe> recipes = (IList<Recipe>)session.CreateQuery(sql)
  6. .SetMaxResults(20)
  7. .List<Recipe>();
  8.  
  9. string sql = "from Recipe r " +
  10. "left join fetch r.Images " +
  11. "inner join fetch r.User " +
  12. "where r.Completed!=0";
  13.  
  14. var recipes = session
  15. .CreateQuery(sql)
  16. .SetResultTransformer(CriteriaUtil.DistinctRootEntity)
  17. .SetMaxResults(20)
  18. .List<Recipe>();
Add Comment
Please, Sign In to add comment