Hibernate QBE查询

Hibernate QBE查询

Criteria criteria =getSession().createCriteria(KjUser.class);//创建查询对象工厂

  KjUser userQbc = new KjUser();

  userQbc.setLoginId("100001");

  Example example=Example.create(userQbc);  

  criteria = criteria.add(example);

  List result = criteria.list(); 

  System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~ ");

  if(result!=null&&result.size()>0)

  System.out.println("##result.size()## "+result.size());

你可能感兴趣的:(Hibernate QBE查询)