01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow.query;
06:
07: import java.io.Serializable;
08:
09: /**
10: * Workflow Query.
11: * A workflow expression-based query is constructed by specifying a number of expressions in the query.
12: * Currently queries can only have one operator act on them. Either the expressions are either evaluated
13: * with an OR, whereby the first expression that passes results in inclusion of a result, or with an AND,
14: * whereby all expressions must return true for a result to be included.
15: *
16: * @author Christine Zimmermann
17: */
18: public class WorkflowExpressionQuery implements Serializable {
19: //~ Static fields/initializers /////////////////////////////////////////////
20:
21: private static final long serialVersionUID = 5810528106491875046L;
22: public static final int SORT_NONE = 0;
23: public static final int SORT_ASC = 1;
24: public static final int SORT_DESC = -1;
25:
26: //~ Instance fields ////////////////////////////////////////////////////////
27:
28: private Expression expression = null;
29: private int orderBy;
30: private int sortOrder;
31:
32: //~ Constructors ///////////////////////////////////////////////////////////
33:
34: public WorkflowExpressionQuery() {
35: }
36:
37: /**
38: * Create a WorkflowExpressionQuery that consists of one expression.
39: */
40: public WorkflowExpressionQuery(Expression expression) {
41: this .expression = expression;
42: }
43:
44: //~ Methods ////////////////////////////////////////////////////////////////
45:
46: public void setExpression(Expression expression) {
47: this .expression = expression;
48: }
49:
50: public Expression getExpression() {
51: return expression;
52: }
53:
54: public void setOrderBy(int orderBy) {
55: this .orderBy = orderBy;
56: }
57:
58: public int getOrderBy() {
59: return orderBy;
60: }
61:
62: public void setSortOrder(int sortOrder) {
63: this .sortOrder = sortOrder;
64: }
65:
66: public int getSortOrder() {
67: return sortOrder;
68: }
69: }
|