Hibernate not equal example criteria

后端 未结 3 658
盖世英雄少女心
盖世英雄少女心 2020-12-17 16:19

Hibernate has example criteria: For example:

Example equal = Example.create(mydbObject);

Is there a way to do the opposite, For example:

3条回答
  •  一向
    一向 (楼主)
    2020-12-17 16:20

    Criteria cri = session.createCriteria(Your.class);
    cri.add(Restrictions.not(Restrictions.eq("parameter", "test")));
    

    -- Restrictions.not will be negation of the expression

提交回复
热议问题