Originally Posted by
sireesha
Hi Every one,
Now my doubt is,Can't we use hibernate for retrieving data form a table? If we can,how to do that ?
we can actually, this example is taken from my application:
public List<Deposito> getDepositosPaging(int start, int length) {
Session session = getSession();
List<Deposito> depositos = (List<Deposito>) session.createQuery("from Deposito where statExist=true order by id ")
.setFirstResult(start)
.setMaxResults(length).list();
return depositos;
}
it retrieve list of Depositos where statExist is true from id=start until id=start+length, ordered by id