正在做一個在線信用充值申請。 我想從數據庫中獲取憑證的類別,類型和麪額。 我需要幫助查詢我插入creatquery()和setparameter()方法。 這是我的代碼片段獲取優惠券。通過多個參數查詢
public String getVoucherPinByCategoryTypeDeno(String category, String type, double denomination) {
return (String) sessionFactory.getCurrentSession().createQuery("from voucher v where v.category = :category and v.voucherType = :type and v.denomination = :denomination").setparameter().uniqueResult();
}
我猜券不是一個字符串 – nachokk
@AlmoullimDev。 PHP的?這是java xD – nachokk
@nachokk哦!!,那麼我一定會失去我的想法'抱歉':L –