hibernate条件查询-----模糊查询==占位符查询

if(condition.get("vendorName")!=null && !condition.get("vendorName").equals("")) {

where += " and v.NAME like :vendorName";}



if(condition.get("vendorName")!=null&& !condition.get("vendorName").equals("") ) {
q.setParameter("vendorName", "%"+condition.get("vendorName")+"%");
}



String bhql = "delete from Biding where biddingId=:id";

Query bq = session.createQuery(bhql);

bq.setParameter("id", id);

你可能感兴趣的:(hibernate条件查询-----模糊查询==占位符查询)