setFloat(int position,float val)
引數說明:String hql = "from GoodsForm where price=?"; //定義查詢HQL語句 Query query = session.createQuery(hql); //執行查詢語句獲取Query物件 query.setFloat(0,29.8); //係結HQL語句引數
setFloat(String name,float val)
引數說明:String hql = "from GoodsForm where price=:price"; //定義查詢HQL語句 Query query = session.createQuery(hql); //執行查詢語句獲取Query物件 query.setFloat("price",29.8); //設定HQL語句請求引數