0 Replies Latest reply on Feb 20, 2009 5:53 AM by xuegong

    How to setup join fetch in HibernateEntityQuery?

      I have a hibernateEntityQuery that involves the joining of 3 entities. Our hibernate default batch size is 25.
      question 1:
      I am trying to pull out all the records but starting to see too many query runs when the record number is high(more than 10k).  We want to try join fetch to solve the problem. Is there anyway to set the fetch type to join fetch in the HibernateEntityQuery class?


      question2:  HibernateEntityQuery can set the maxresult which I assume is batch fetching and I set it to 25.  However, each time I run this HibernateEntityQuery, I usually see 2 sql queries at the end with select ... where id is in (?,?,?). The first one has 25 items in the in clause, the second one has a few.  Why it run the second query? isn't it suppose to return 25 records anyway?


      I am relatively new to seam and HibernateEntityQuery so I hope what I said here makes sense.