本文整理匯總了Java中org.hibernate.Query.setByte方法的典型用法代碼示例。如果您正苦於以下問題:Java Query.setByte方法的具體用法?Java Query.setByte怎麽用?Java Query.setByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.hibernate.Query
的用法示例。
在下文中一共展示了Query.setByte方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: search
import org.hibernate.Query; //導入方法依賴的package包/類
@Override
public List<MarketApp> search(EnumMarket enumMarket, Short catalog, Integer subCatalog, int page, int rows,
String keywords, Integer id, Integer cputype, String sort, String order, Date startDate, Date endDate) {
List<MarketApp> list = null;
// cpu的類型為空的時候我們隻需要到MarketApp中查找
if (cputype == null)
cputype = 0;
if (cputype.byteValue() == 0) {
list = findMarketAppList(enumMarket, catalog, subCatalog, page, rows, keywords, id, sort, order, startDate,
endDate);
} else { // cpu的類型為空的時候我們需要先到BigGamePack中查詢一下然後再到MarketApp中查找
list = new ArrayList<MarketApp>();
List<MarketApp> marketList = findMarketAppList(enumMarket, catalog, subCatalog, page, rows, keywords, id,
sort, order, startDate, endDate);
String hql = "from BigGamePack where cputype =:cputype group by MarketAppId";
Query query = getSession().createQuery(hql);
query.setByte("cputype", cputype.byteValue());
List<BigGamePack> bgList = HibernateHelper.list(query);
if (null != bgList && bgList.size() > 0 && null != marketList && marketList.size() > 0) {
for (BigGamePack bigGamePack : bgList) {
for (MarketApp mp : marketList) {
if (mp.getId() == bigGamePack.getMarketAppId()) {
list.add(mp);
}
}
}
}
}
return list;
}