Issue with writing a criteria /hibernate query? -
How can we write the following SQL queries in the criteria query and also in the Hibernate query?
The following types of sql queries, select
- Test ID DESC limit 1 from table 1 command;
I have written as follows,
Standards TobaccoID = SessionFighter .getCurrentSession (). CreateCriteria (table1.class); TobaccoID.add (Restrictions.eq ("surveyId", send_Survey)); TobaccoID.addOrder (Order.desc ("testId")); // How can I specify 1 limit here in the tobacco id? Restrictions ("Restrictions" ("Algorithm", Lifestyle Hbbs on)); Tobacco id.ed. (restrictions .ec ("string no", "01")); Scrollable tobacco idp = tobacco id. Scroll ();
But I do not know how I can set limits here.
Any suggestions.
Comments
Post a Comment