关于query自定义条件查询~
自定义条件就要写自己的查询条件
首先定义
private List<String> conditions=new ArrayList<String>();
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
public void searchOrder(){
//String EJBQL = "select customerOrder from CustomerOrder customerOrder";
if(this.timeBegin!=null){
conditions.add("customerOrder.timeCreated>=#{customerOrderList.timeBegin}");
}
setEjbql(EJBQL);
setRestrictionExpressionStrings(conditions);
setMaxResults(25);
this.refresh();
//return this.getResultList();
}