package org.domain.zzzzzz2.session;

import org.domain.zzzzzz2.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("ordersList")
public class OrdersList extends EntityQuery<Orders> {

	private static final String EJBQL = "select orders from Orders orders";

	private static final String[] RESTRICTIONS = {
			"lower(orders.status) like lower(concat(#{ordersList.orders.status},'%'))",
			"lower(orders.comments) like lower(concat(#{ordersList.orders.comments},'%'))", };

	private Orders orders = new Orders();

	public OrdersList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Orders getOrders() {
		return orders;
	}
}
