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

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -