我试了一下,可以呀,
我的输出条件:
where (this.PASSWORD is null and this.FIRST_NAME is null and this.LAST_NAME is null and this.USER_STATUS is null and this.CREATE_DATE is null and this.EXPIRATION_DATE is null and this.IS_ADMIN=? and lower(this.USER_CSS_STYLE) like ? and this.ADDRESS1 is null and this.EMAIL is null and this.FAX_NO is null and this.PHONE_NO is null and this.ZIP_CODE is null and this.ADDRESS2 is null and this.description is null and lower(this.name) like ?)
我的测试代码:
SessionFactory sf =cfg.configure( new File("hibernate.cfg.xml")).buildSessionFactory();
Session session = sf.openSession();
Tuser user = new Tuser();
user.setName("admin");
user.setUserCssStyle("x");
 Example example = Example.create(user);
        example.ignoreCase().enableLike();
        example.excludeZeroes();
        example.excludeNone();
        Criteria criteria = session.createCriteria(Tuser.class).add(
                example);
        //criteria.setMaxResults(10);
       List list= criteria.list();
       System.out.print(list.size());