What is difference between setMaxResults and setFetchSize in org.hibernate.Query? I just can no get it =)
What is difference between setMaxResults and setFetchSize in org.hibernate.Query? I just can no get
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
setMaxResultsis the same asLIMITin SQL- you are setting the maximum number of rows you want returned. This is a very common use case of course.setFetchSizeis about optimization, which can change how Hibernate goes about sending the results to the caller (example: buffered, in different size chunks).setFetchSizeis NOT implemented by all database drivers.