如何在MySQL中使用hibernate从表中获取行? [英] How to fetch rows from middle of the table in mysql using hibernate?
问题描述
我必须在UI上显示数据库表中的行。所以,可以说我们在表格中有200行。所以,我的第一击会给我前20行。现在,我想在下一次击中获取下20行。我使用Hibernate来处理数据库的CRUD操作。
query.setMaxResults(int size)对于第一次打击可以正常工作。但是如何处理第二次和以后的事务? / p>
查询
请参阅 http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/ Query.html
I have to display rows from the database table on the UI. So, lets say we have 200 rows in the table. So , my first hit will give me first 20 rows. Now, i want to fetch next 20 rows in the next hit. I am using Hibernate for handling database CRUD operations.
query.setMaxResults(int size) works fine for first hit .But how to handle transactions for 2nd and onwards hits ?
Query
- a particular page of the result set may be selected by calling setMaxResults(), setFirstResult().
see http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/Query.html
这篇关于如何在MySQL中使用hibernate从表中获取行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!