setMaxResults
is the same as LIMIT
in SQL- you are setting the maximum number of rows you want returned. This is a very common use case of course.
setFetchSize
is about optimization, which can change how Hibernate goes about sending the results to the caller (example: buffered, in different size chunks).
setFetchSize
is NOT implemented by all database drivers.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…