java - Does Hibernate SQLQuery restrict the results with native features when using setMaxResults to limit results -
when using sqlquery setmaxresults() method limit number of records returned, hibernate limit results using native features of database top or limit keywords or hibernate limit results @ library layer after results returned?
thanks, keshav
the number of records returned done @ query level. uses database keywords limit restrict number of rows returned.
you can turn on hibernate.show_sql fetature , see generated query.
code:
sqlquery sqlquery = session.createsqlquery("select * request_t"); sqlquery.setmaxresults(10); list results = sqlquery.list();
hibernate generated query:
/* dynamic native sql query */
select * request_t limit ?
hibernate: /* dynamic native sql query */
select * request_t limit ?
Comments
Post a Comment