001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.sql.framework.model;
042:
043: /**
044: * Constants used in the SQLBuilder Repository Model API and implementation packages.
045: *
046: * @author Ritesh Adval
047: * @version $Revision$
048: */
049: public class SQLConstants {
050:
051: /** int constant for operator object type */
052: public static final int GENERIC_OPERATOR = 10000;
053:
054: /** int constant for join object type */
055: public static final int JOIN = 10001;
056:
057: /** int constant for literal object type */
058: public static final int LITERAL = 10002;
059:
060: /** int constant for case object type */
061: public static final int CASE = 10003;
062:
063: /** int constant for when object type */
064: public static final int WHEN = 10004;
065:
066: /** int constant for predicate object type */
067: public static final int PREDICATE = 10005;
068:
069: /** int constant for source database object type */
070: public static final int SOURCE_DBMODEL = 10006;
071:
072: /** int constant for destination database object type */
073: public static final int TARGET_DBMODEL = 10007;
074:
075: /** int constant for source table object type */
076: public static final int SOURCE_TABLE = 10008;
077:
078: /** int constant for destination table object type */
079: public static final int TARGET_TABLE = 10009;
080:
081: /** int constant for source column object type */
082: public static final int SOURCE_COLUMN = 10010;
083:
084: /** int constant for destination table object type */
085: public static final int TARGET_COLUMN = 10011;
086:
087: /** int constant for visible predicate object type */
088: public static final int VISIBLE_PREDICATE = 10012;
089:
090: /** int constant for filter object type */
091: public static final int FILTER = 10013;
092:
093: /** int constant for visible literal object type */
094: public static final int VISIBLE_LITERAL = 10014;
095:
096: /** int constant for cast operator object type */
097: public static final int CAST_OPERATOR = 10015;
098:
099: /** int constant for cast operator object type */
100: public static final int RUNTIME_ARGS = 10016;
101:
102: /** int constant for runtime input object type */
103: public static final int RUNTIME_INPUT = 10017;
104:
105: /** int constant for runtime output object type */
106: public static final int RUNTIME_OUTPUT = 10018;
107:
108: /** int constant for runtime dbmodel object type */
109: public static final int RUNTIME_DBMODEL = 10019;
110:
111: /** int constants for column reference * */
112: public static final int COLUMN_REF = 10020;
113:
114: public static final int JOIN_TABLE = 10022;
115:
116: public static final int JOIN_TABLE_COLUMN = 10023;
117:
118: public static final int JOIN_VIEW = 10024;
119:
120: public static final int DATE_DIFF_OPERATOR = 10025;
121:
122: public static final int DATE_ADD_OPERATOR = 10026;
123:
124: public static final int DATE_ARITHMETIC_OPERATOR = 10027;
125:
126: public static final int CUSTOM_OPERATOR = 10028;
127:
128: /** Operator script that takes fixed number of input arguments. */
129: public static final int OPERATOR_ARGS_FIXED = -1233;
130:
131: /** Operator script that takes variable number of arguments. */
132: public static final int OPERATOR_ARGS_VARIABLE = -1234;
133:
134: /**
135: * Suffix string that is appened to argument name in case an operator takes variable
136: * number of arguments.
137: */
138: public static final String OPERATOR_VARIABLE_SUFFIX = "-var-";
139:
140: /** Prefix symbol for all operator variables. */
141: public static final String OPERATOR_VARIABLE_PREFIX = "$";
142:
143: /** Undefined jdbc type */
144: public static final int JDBCSQL_TYPE_UNDEFINED = -65535;
145:
146: /** unknown state for type check */
147: public static final int TYPE_CHECK_UNKNOWN = 0;
148:
149: /** types being compared are same. */
150: public static final int TYPE_CHECK_SAME = 1;
151:
152: /** types being compared are different but compatible. */
153: public static final int TYPE_CHECK_COMPATIBLE = 2;
154:
155: /** * types being compared are incompatible */
156: public static final int TYPE_CHECK_INCOMPATIBLE = 3;
157:
158: /** * types being compared are incompatible */
159: public static final int TYPE_CHECK_DOWNCAST_WARNING = 4;
160:
161: /** Inner Join */
162: public static final int INNER_JOIN = 1;
163:
164: /** Left Outer Join */
165: public static final int LEFT_OUTER_JOIN = 2;
166:
167: /** Right Outer Join */
168: public static final int RIGHT_OUTER_JOIN = 3;
169:
170: /** Full Outer Join */
171: public static final int FULL_OUTER_JOIN = 4;
172:
173: // --------------------- End of Join Types --------------------------
174:
175: // --------------------- Start of Operator Type Names --------------------------
176:
177: /** Generic Operator String rep. */
178: public static final String STR_GENERIC_OPERATOR = "generic_operator"; // NOI18N
179:
180: /** Generic Operator String rep. */
181: public static final String STR_SCALAR_OPERATOR = "scalar_operator"; // NOI18N
182:
183: /** Join Operator String Rep. */
184: public static final String STR_JOIN_OPERATOR = "join_operator"; // NOI18N
185:
186: /** Literal Operator String Rep. */
187: public static final String STR_LITERAL_OPERATOR = "literal"; // NOI18N
188:
189: /** Case Operator String rep. */
190: public static final String STR_CASE_OPERATOR = "case_operator"; // NOI18N
191:
192: /** Predicate String Rep */
193: public static final String STR_PREDICATE = "predicate"; // NOI18N
194:
195: /** When String rep */
196: public static final String STR_WHEN = "when"; // NOI18N
197:
198: /** Source column String rep */
199: public static final String STR_SOURCE_COLUMN = "source_column"; // NOI18N
200:
201: /** Target column String rep */
202: public static final String STR_TARGET_COLUMN = "target_column"; // NOI18N
203:
204: /** source DBModel */
205: public static final String STR_SOURCE_DBMODEL = "source_dbmodel"; // NOI18N
206:
207: /** Target DBModel */
208: public static final String STR_TARGET_DBMODEL = "target_dbmodel"; // NOI18N
209:
210: /** source table */
211: public static final String STR_SOURCE_TABLE = "source_table"; // NOI18N
212:
213: /** Target table */
214: public static final String STR_TARGET_TABLE = "target_table"; // NOI18N
215:
216: /** Visible predicate */
217: public static final String STR_VISIBLE_PREDICATE = "visible_predicate"; // NOI18N
218:
219: /** Filter */
220: public static final String STR_FILTER = "filter"; // NOI18N
221:
222: /** Visible literal */
223: public static final String STR_VISIBLE_LITERAL = "visible_literal"; // NOI18N
224:
225: /** cast operator */
226: public static final String STR_CAST_OPERATOR = "cast_operator"; // NOI18N
227:
228: /** runtime operator */
229: public static final String STR_RUNTIME_ARGS = "runtime_args"; // NOI18N
230:
231: /** runtime input operator */
232: public static final String STR_RUNTIME_INPUT = "runtime_input"; // NOI18N
233:
234: /** runtime output operator */
235: public static final String STR_RUNTIME_OUTPUT = "runtime_output"; // NOI18N
236:
237: /** runtime dbmodel */
238: public static final String STR_RUNTIME_DBMODEL = "runtime_dbmodel"; // NOI18N
239:
240: /** column ref */
241: public static final String STR_COLUMN_REF = "column_ref"; // NOI18N
242:
243: public static final String STR_JOIN_VIEW = "join_view";
244:
245: public static final String STR_JOIN_TABLE = "join_table";
246:
247: public static final String STR_JOIN_TABLE_COLUMN = "join_table_column";
248:
249: public static final String STR_DATEDIFF_OPERATOR = "datediff_operator";
250:
251: public static final String STR_DATEADD_OPERATOR = "dateadd_operator";
252:
253: public static final String STR_CUSTOM_OPERATOR = "custom_operator"; // NOI18N
254:
255: // --------------------- End of Operator Type Names --------------------------
256:
257: // --------------------- Start of Operator Display Names --------------------------
258:
259: /** Display string for operator */
260: public static final String DISPLAY_STR_GENERIC_OPERATOR = "operator";
261:
262: /** Display string for operator */
263: public static final String DISPLAY_STR_CAST_OPERATOR = "cast operator";
264:
265: /** Display string for operator */
266: public static final String DISPLAY_RUNTIME_ARGS = "runtime argument";
267:
268: /** Display string for join */
269: public static final String DISPLAY_STR_JOIN_OPERATOR = "join operator";
270:
271: /** Display string for literal / visible literal */
272: public static final String DISPLAY_STR_LITERAL_OPERATOR = "literal";
273:
274: /** Display string for case-when operator */
275: public static final String DISPLAY_STR_CASE_OPERATOR = "case-when operator";
276:
277: /** Display string for predicate / visible predicate. */
278: public static final String DISPLAY_STR_PREDICATE = "predicate";
279:
280: /** Display string for when element in case-when operator */
281: public static final String DISPLAY_STR_WHEN = "when element";
282:
283: /** Display string for source column */
284: public static final String DISPLAY_STR_SOURCE_COLUMN = "source column";
285:
286: /** Display string for target column */
287: public static final String DISPLAY_STR_TARGET_COLUMN = "target column";
288:
289: /** Display string for source database model */
290: public static final String DISPLAY_STR_SOURCE_DBMODEL = "source database model";
291:
292: /** Display string for target database model */
293: public static final String DISPLAY_STR_TARGET_DBMODEL = "target database model";
294:
295: /** Display string for source table */
296: public static final String DISPLAY_STR_SOURCE_TABLE = "source table";
297:
298: /** Display string for target table */
299: public static final String DISPLAY_STR_TARGET_TABLE = "target table";
300:
301: /** Display string for filter */
302: public static final String DISPLAY_STR_FILTER = "filter";
303:
304: public static final String DISPLAY_STR_RUNTIME_INPUT = "runtime input";
305:
306: public static final String DISPLAY_STR_RUNTIME_OUTPUT = "runtime output";
307:
308: public static final String DISPLAY_STR_RUNTIME_DBMODEL = "runtime database model";
309:
310: public static final String DISPLAY_STR_COLUMN_REF = "column";
311:
312: public static final String DISPLAY_STR_JOIN_VIEW = "join view";
313:
314: public static final String DISPLAY_STR_JOIN_TABLE = "join table";
315:
316: public static final String DISPLAY_STR_JOIN_TABLE_COLUMN = "join table column";
317:
318: public static final String DISPLAY_STR_DATEDIFF_OPERATOR = "datediff operator";
319:
320: public static final String DISPLAY_STR_DATEADD_OPERATOR = "dateadd operator";
321:
322: public static final String DISPLAY_STR_USER_FUNCTION = "user function";
323:
324: // --------------------- End of Operator Display Names --------------------------
325:
326: /** Maximum allowable arguments in an operator script. */
327: public static final int MAX_SCRIPT_ARGUMENT_COUNT = 100;
328:
329: /** String representation of Operator "=" */
330: public static final String OPERATOR_STR_EQUAL = "=";
331:
332: /** NULL string */
333: public static final String STR_NULL = "NULL";
334:
335: // --------------------- End of Operator Constants --------------------------
336:
337: /**
338: * constants for statement type in target table
339: */
340: public static final int INSERT_STATEMENT = 0;
341:
342: /** insert and update statement using merge syntax */
343: public static final int INSERT_UPDATE_STATEMENT = 1;
344:
345: /** update statement by set column syntax */
346: public static final int UPDATE_STATEMENT = 2;
347:
348: /** delete statement */
349: public static final int DELETE_STATEMENT = 3;
350:
351: /**
352: * constants for statement type in target table
353: */
354: public static final String STR_INSERT_STATEMENT = "insert";
355:
356: /** insert and update statement using merge syntax */
357: public static final String STR_INSERT_UPDATE_STATEMENT = "insert_update";
358:
359: /** update statement by set column syntax */
360: public static final String STR_UPDATE_STATEMENT = "update";
361:
362: /** delete statement */
363: public static final String STR_DELETE_STATEMENT = "delete";
364:
365: public static final String EXTRACTION_FULL = "full";
366:
367: public static final String EXTRACTION_CONDITIONAL = "conditional";
368:
369: public static final String SOURCE_DB_MODEL_NAME_SUFFIX = "-Source";
370:
371: public static final String TARGET_DB_MODEL_NAME_SUFFIX = "-Target";
372: }
|