Criteria add(Criterion criterion)
引數說明:Session session = sessionFactory.openSession(); //建立session範例 List list = null; try{ Criteria criteria = session.createCriteria(UserForm.class); //獲取Criteria物件 criteria.add(Restrictions.eq("username","sk")); list = criteria.list(); }catch(Exception e){ System.out.println("查詢使用者資訊時的錯誤資訊:"+e.getMessage()); }