参考如下:
/**
* 功能:根据品牌查询
*
* @param pageSize
* 每页大小
* @param currentLPagem
* 当前第几页
* @param productBlack
* 产品品牌
* @param productBlackItem
* 产品分类
* @param productSize
* 产品尺码
* @param keyWord
* 搜索关键字
* @return
*/
public pageBean seachProductByBrank(int pageSize, int currentLPage,
String product_Brank, String product_itemName) {
// final String hql = "from " + OgrilProducts.class.getName()
// + " where product_Brank='" + product_Brank
// + "' and product_itemName='" + product_itemName
// + "' order by product_registerDate desc";
final String hql = " from "
+ OgrilProducts.class.getName()
+ " as product where product.productItemName='"
+ product_itemName
+ "' and productBrank='"
+ product_Brank
+ "' and not exists( from "
+ OgrilProducts.class.getName()
+ " where productItemName='"
+ product_itemName
+ "' and productBrank='"
+ product_Brank
+ "' and productItemNumber=product.productItemNumber and productId