KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > commons > dsi > dml > FunctionedWhereCondition


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.commons.dsi.dml;
20
21 import java.util.Vector JavaDoc;
22
23 import org.openharmonise.commons.dsi.*;
24
25
26 /**
27  * WhereCondition which includes a SQL function manipulation on the value of the DB
28  * column before comparison.
29  *
30  * <emph>Note: the default comparison operator is '='.</emph>
31  *
32  * @author Michael Bell
33  * @version $Revision: 1.1 $
34  *
35  */

36 public class FunctionedWhereCondition extends WhereCondition {
37
38     /**
39      * Function to be used in where condition.
40      */

41     private Function m_func = null;
42
43     /**
44      * Constructs a where condition which can have a function applied.
45      *
46      * @param colref condition column reference
47      * @param val value for comparison
48      * @throws DataStoreException if condition is invalid
49      */

50     public FunctionedWhereCondition(ColumnRef colref, int val)
51         throws DataStoreException {
52         super(colref, val);
53     }
54
55     /**
56      * Constructs a where condtion which can have a function applied.
57      *
58      * @param colref condition column reference
59      * @param sOp condition comparison operator
60      * @param val value for comparison
61      * @throws DataStoreException if condition is invalid
62      */

63     public FunctionedWhereCondition(ColumnRef colref, String JavaDoc sOp, int val)
64         throws DataStoreException {
65         super(colref, sOp, val);
66     }
67
68     /**
69      * Constructs a where condtion which can have a function applied.
70      *
71      * @param colref condition column reference
72      * @param val value for comparison
73      * @throws DataStoreException if condition is invalid
74      */

75     public FunctionedWhereCondition(ColumnRef colref, Object JavaDoc val)
76         throws DataStoreException {
77         super(colref, val);
78     }
79
80     /**
81      * Constructs a where condtion which can have a function applied.
82      *
83      * @param colref condition column reference
84      * @param sOp condition comparison operator
85      * @param val value for comparison
86      * @throws DataStoreException if condition is invalid
87      */

88     public FunctionedWhereCondition(ColumnRef colref, String JavaDoc sOp, Object JavaDoc val)
89         throws DataStoreException {
90         super(colref, sOp, val);
91     }
92
93     /**
94      * Constructs a where condtion which can have a function applied.
95      *
96      * @param colref condition column reference
97      * @param val list of values for comparison
98      * @throws DataStoreException if condition is invalid
99      */

100     public FunctionedWhereCondition(ColumnRef colref, Vector JavaDoc val)
101         throws DataStoreException {
102         super(colref, val);
103     }
104
105     /**
106      * Constructs a where condtion which can have a function applied.
107      *
108      * @param colref condition column reference
109      * @param sOp condition comparison operator
110      * @param val list of values for comparison
111      * @throws DataStoreException if condition is invalid
112      */

113     public FunctionedWhereCondition(ColumnRef colref, String JavaDoc sOp, Vector JavaDoc val)
114         throws DataStoreException {
115         super(colref, sOp, val);
116     }
117     
118     /**
119      * Sets function for this functioned condition.
120      *
121      * @param func Function to be used in this condition
122      */

123     public void setFunction(Function func) {
124         m_func = func;
125     }
126     
127     /**
128      * Returns the function to be applied to this condition.
129      *
130      * @return the function to be applied to this condition
131      */

132     public Function getFunction() {
133         return m_func;
134     }
135
136 }
137
Popular Tags