Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

hibernate criteria

I was reading folowing lines of junit test script code and I did not understand clearly what criteria and what restrictions do.

@Test
      public void testCriteriaForPresence() throws Exception {
            final Session session = sessionFactory.getCurrentSession();
            final Criteria criteria = session.createCriteria(Test.class).add(Restrictions.eq("flag", false));
            printList(criteria.list());
      }

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
0
gudii9
Asked:
gudii9
2 Solutions
 
cmalakarCommented:
Hibernate Criteria is basically used to create the search criteria.

Restrictions will be used to add conditions.

http://www.devarticles.com/c/a/Java/Hibernate-Criteria-Queries-in-Depth/

0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now