KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > sql > compile > NodeFactory


1 /*
2
3    Derby - Class org.apache.derby.iapi.sql.compile.NodeFactory
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.sql.compile;
23
24 import java.util.Properties JavaDoc;
25
26 import org.apache.derby.iapi.services.context.ContextManager;
27
28 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
29 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
30
31 import org.apache.derby.iapi.error.StandardException;
32
33 /* Strictly speaking we shouldn't import classes under the impl hierarchy here
34  * but this is work in progress.
35  * manish - Wed Mar 28 13:05:19 PST 2001
36  */

37 import org.apache.derby.impl.sql.compile.QueryTreeNode;
38 import org.apache.derby.impl.sql.compile.ResultColumnList;
39 import org.apache.derby.impl.sql.compile.ResultSetNode;
40
41 /**
42     This is an interface for NodeFactories.
43     <p>
44     There is expected to be only one of these configured per database.
45
46    @author Rick Hillegas
47  */

48
49 public abstract class NodeFactory
50 {
51     /**
52         Module name for the monitor's module locating system.
53      */

54     public static final String JavaDoc MODULE = "org.apache.derby.iapi.sql.compile.NodeFactory";
55
56     /**
57      * Tell whether to do join order optimization.
58      *
59      * @return Boolean.TRUE means do join order optimization, Boolean.FALSE
60      * means don't do it.
61      */

62     public abstract Boolean JavaDoc doJoinOrderOptimization();
63
64     /**
65      * Get a node that takes no initializer arguments.
66      *
67      * @param nodeType Identifier for the type of node.
68      * @param cm A ContextManager
69      *
70      * @return A new QueryTree node.
71      *
72      * @exception StandardException Thrown on error.
73      */

74     public abstract QueryTreeNode getNode(int nodeType,
75                             ContextManager cm) throws StandardException;
76
77     /**
78      * Get a node that takes one initializer argument.
79      *
80      * @param nodeType Identifier for the type of node.
81      * @param arg1 The initializer argument
82      * @param cm A ContextManager
83      *
84      * @return A new QueryTree node.
85      *
86      * @exception StandardException Thrown on error.
87      */

88     public final QueryTreeNode getNode(int nodeType, Object JavaDoc arg1, ContextManager cm)
89                                                     throws StandardException
90     {
91         QueryTreeNode retval = getNode(nodeType, cm);
92
93         retval.init(arg1);
94
95         return retval;
96     }
97
98     /**
99      * Get a node that takes two initializer arguments.
100      *
101      * @param nodeType Identifier for the type of node.
102      * @param arg1 An initializer argument
103      * @param arg2 An initializer argument
104      * @param cm A ContextManager
105      *
106      * @return A new QueryTree node.
107      *
108      * @exception StandardException Thrown on error.
109      */

110     public final QueryTreeNode getNode(int nodeType,
111                             Object JavaDoc arg1,
112                             Object JavaDoc arg2,
113                             ContextManager cm)
114                                 throws StandardException
115     {
116         QueryTreeNode retval = getNode(nodeType, cm);
117
118         retval.init(arg1, arg2);
119
120         return retval;
121     }
122
123     /**
124      * Get a node that takes three initializer arguments.
125      *
126      * @param nodeType Identifier for the type of node.
127      * @param arg1 An initializer argument
128      * @param arg2 An initializer argument
129      * @param arg3 An initializer argument
130      * @param cm A ContextManager
131      *
132      * @return A new QueryTree node.
133      *
134      * @exception StandardException Thrown on error.
135      */

136     public final QueryTreeNode getNode(int nodeType,
137                             Object JavaDoc arg1,
138                             Object JavaDoc arg2,
139                             Object JavaDoc arg3,
140                             ContextManager cm)
141                                 throws StandardException
142     {
143         QueryTreeNode retval = getNode(nodeType, cm);
144
145         retval.init(arg1, arg2, arg3);
146
147         return retval;
148     }
149
150     /**
151      * Get a node that takes four initializer arguments.
152      *
153      * @param nodeType Identifier for the type of node.
154      * @param arg1 An initializer argument
155      * @param arg2 An initializer argument
156      * @param arg3 An initializer argument
157      * @param arg4 An initializer argument
158      * @param cm A ContextManager
159      *
160      * @return A new QueryTree node.
161      *
162      * @exception StandardException Thrown on error.
163      */

164     public QueryTreeNode getNode(int nodeType,
165                             Object JavaDoc arg1,
166                             Object JavaDoc arg2,
167                             Object JavaDoc arg3,
168                             Object JavaDoc arg4,
169                             ContextManager cm)
170                                 throws StandardException
171     {
172         QueryTreeNode retval = getNode(nodeType, cm);
173
174         retval.init(arg1, arg2, arg3, arg4);
175
176         return retval;
177     }
178
179
180     /**
181      * Get a node that takes five initializer arguments.
182      *
183      * @param nodeType Identifier for the type of node.
184      * @param arg1 An initializer argument
185      * @param arg2 An initializer argument
186      * @param arg3 An initializer argument
187      * @param arg4 An initializer argument
188      * @param arg5 An initializer argument
189      * @param cm A ContextManager
190      *
191      * @return A new QueryTree node.
192      *
193      * @exception StandardException Thrown on error.
194      */

195     public QueryTreeNode getNode(int nodeType,
196                             Object JavaDoc arg1,
197                             Object JavaDoc arg2,
198                             Object JavaDoc arg3,
199                             Object JavaDoc arg4,
200                             Object JavaDoc arg5,
201                             ContextManager cm)
202                                 throws StandardException
203     {
204         QueryTreeNode retval = getNode(nodeType, cm);
205
206         retval.init(arg1, arg2, arg3, arg4, arg5);
207
208         return retval;
209     }
210
211     /**
212      * Get a node that takes six initializer arguments.
213      *
214      * @param nodeType Identifier for the type of node.
215      * @param arg1 An initializer argument
216      * @param arg2 An initializer argument
217      * @param arg3 An initializer argument
218      * @param arg4 An initializer argument
219      * @param arg5 An initializer argument
220      * @param arg6 An initializer argument
221      * @param cm A ContextManager
222      *
223      * @return A new QueryTree node.
224      *
225      * @exception StandardException Thrown on error.
226      */

227     public final QueryTreeNode getNode(int nodeType,
228                             Object JavaDoc arg1,
229                             Object JavaDoc arg2,
230                             Object JavaDoc arg3,
231                             Object JavaDoc arg4,
232                             Object JavaDoc arg5,
233                             Object JavaDoc arg6,
234                             ContextManager cm)
235                                 throws StandardException
236     {
237         QueryTreeNode retval = getNode(nodeType, cm);
238
239         retval.init(arg1, arg2, arg3, arg4, arg5, arg6);
240
241         return retval;
242     }
243
244     /**
245      * Get a node that takes seven initializer arguments.
246      *
247      * @param nodeType Identifier for the type of node.
248      * @param arg1 An initializer argument
249      * @param arg2 An initializer argument
250      * @param arg3 An initializer argument
251      * @param arg4 An initializer argument
252      * @param arg5 An initializer argument
253      * @param arg6 An initializer argument
254      * @param arg7 An initializer argument
255      * @param cm A ContextManager
256      *
257      * @return A new QueryTree node.
258      *
259      * @exception StandardException Thrown on error.
260      */

261     public final QueryTreeNode getNode(int nodeType,
262                             Object JavaDoc arg1,
263                             Object JavaDoc arg2,
264                             Object JavaDoc arg3,
265                             Object JavaDoc arg4,
266                             Object JavaDoc arg5,
267                             Object JavaDoc arg6,
268                             Object JavaDoc arg7,
269                             ContextManager cm)
270                                 throws StandardException
271     {
272         QueryTreeNode retval = getNode(nodeType, cm);
273
274         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
275
276         return retval;
277     }
278     /**
279      * Get a node that takes eight initializer arguments.
280      *
281      * @param nodeType Identifier for the type of node.
282      * @param arg1 An initializer argument
283      * @param arg2 An initializer argument
284      * @param arg3 An initializer argument
285      * @param arg4 An initializer argument
286      * @param arg5 An initializer argument
287      * @param arg6 An initializer argument
288      * @param arg7 An initializer argument
289      * @param arg8 An initializer argument
290      * @param cm A ContextManager
291      *
292      * @return A new QueryTree node.
293      *
294      * @exception StandardException Thrown on error.
295      */

296     public final QueryTreeNode getNode(int nodeType,
297                             Object JavaDoc arg1,
298                             Object JavaDoc arg2,
299                             Object JavaDoc arg3,
300                             Object JavaDoc arg4,
301                             Object JavaDoc arg5,
302                             Object JavaDoc arg6,
303                             Object JavaDoc arg7,
304                             Object JavaDoc arg8,
305                             ContextManager cm)
306                                 throws StandardException
307     {
308         QueryTreeNode retval = getNode(nodeType, cm);
309
310         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
311
312         return retval;
313     }
314     /**
315      * Get a node that takes nine initializer arguments.
316      *
317      * @param nodeType Identifier for the type of node.
318      * @param arg1 An initializer argument
319      * @param arg2 An initializer argument
320      * @param arg3 An initializer argument
321      * @param arg4 An initializer argument
322      * @param arg5 An initializer argument
323      * @param arg6 An initializer argument
324      * @param arg7 An initializer argument
325      * @param arg8 An initializer argument
326      * @param arg9 An initializer argument
327      * @param cm A ContextManager
328      *
329      * @return A new QueryTree node.
330      *
331      * @exception StandardException Thrown on error.
332      */

333     public final QueryTreeNode getNode(int nodeType,
334                             Object JavaDoc arg1,
335                             Object JavaDoc arg2,
336                             Object JavaDoc arg3,
337                             Object JavaDoc arg4,
338                             Object JavaDoc arg5,
339                             Object JavaDoc arg6,
340                             Object JavaDoc arg7,
341                             Object JavaDoc arg8,
342                             Object JavaDoc arg9,
343                             ContextManager cm)
344                                 throws StandardException
345     {
346         QueryTreeNode retval = getNode(nodeType, cm);
347
348         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
349
350         return retval;
351     }
352     /**
353      * Get a node that takes ten initializer arguments.
354      *
355      * @param nodeType Identifier for the type of node.
356      * @param arg1 An initializer argument
357      * @param arg2 An initializer argument
358      * @param arg3 An initializer argument
359      * @param arg4 An initializer argument
360      * @param arg5 An initializer argument
361      * @param arg6 An initializer argument
362      * @param arg7 An initializer argument
363      * @param arg8 An initializer argument
364      * @param arg9 An initializer argument
365      * @param arg10 An initializer argument
366      * @param cm A ContextManager
367      *
368      * @return A new QueryTree node.
369      *
370      * @exception StandardException Thrown on error.
371      */

372     public final QueryTreeNode getNode(int nodeType,
373                             Object JavaDoc arg1,
374                             Object JavaDoc arg2,
375                             Object JavaDoc arg3,
376                             Object JavaDoc arg4,
377                             Object JavaDoc arg5,
378                             Object JavaDoc arg6,
379                             Object JavaDoc arg7,
380                             Object JavaDoc arg8,
381                             Object JavaDoc arg9,
382                             Object JavaDoc arg10,
383                             ContextManager cm)
384                                 throws StandardException
385     {
386         QueryTreeNode retval = getNode(nodeType, cm);
387
388         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
389                     arg10);
390
391         return retval;
392     }
393     /**
394      * Get a node that takes eleven initializer arguments.
395      *
396      * @param nodeType Identifier for the type of node.
397      * @param arg1 An initializer argument
398      * @param arg2 An initializer argument
399      * @param arg3 An initializer argument
400      * @param arg4 An initializer argument
401      * @param arg5 An initializer argument
402      * @param arg6 An initializer argument
403      * @param arg7 An initializer argument
404      * @param arg8 An initializer argument
405      * @param arg9 An initializer argument
406      * @param arg10 An initializer argument
407      * @param arg11 An initializer argument
408      * @param cm A ContextManager
409      *
410      * @return A new QueryTree node.
411      *
412      * @exception StandardException Thrown on error.
413      */

414     public final QueryTreeNode getNode(int nodeType,
415                             Object JavaDoc arg1,
416                             Object JavaDoc arg2,
417                             Object JavaDoc arg3,
418                             Object JavaDoc arg4,
419                             Object JavaDoc arg5,
420                             Object JavaDoc arg6,
421                             Object JavaDoc arg7,
422                             Object JavaDoc arg8,
423                             Object JavaDoc arg9,
424                             Object JavaDoc arg10,
425                             Object JavaDoc arg11,
426                             ContextManager cm)
427                                 throws StandardException
428     {
429         QueryTreeNode retval = getNode(nodeType, cm);
430
431         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
432                     arg10, arg11);
433
434         return retval;
435     }
436     /**
437      * Get a node that takes twelve initializer arguments.
438      *
439      * @param nodeType Identifier for the type of node.
440      * @param arg1 An initializer argument
441      * @param arg2 An initializer argument
442      * @param arg3 An initializer argument
443      * @param arg4 An initializer argument
444      * @param arg5 An initializer argument
445      * @param arg6 An initializer argument
446      * @param arg7 An initializer argument
447      * @param arg8 An initializer argument
448      * @param arg9 An initializer argument
449      * @param arg10 An initializer argument
450      * @param arg11 An initializer argument
451      * @param arg12 An initializer argument
452      * @param cm A ContextManager
453      *
454      * @return A new QueryTree node.
455      *
456      * @exception StandardException Thrown on error.
457      */

458     public final QueryTreeNode getNode(int nodeType,
459                             Object JavaDoc arg1,
460                             Object JavaDoc arg2,
461                             Object JavaDoc arg3,
462                             Object JavaDoc arg4,
463                             Object JavaDoc arg5,
464                             Object JavaDoc arg6,
465                             Object JavaDoc arg7,
466                             Object JavaDoc arg8,
467                             Object JavaDoc arg9,
468                             Object JavaDoc arg10,
469                             Object JavaDoc arg11,
470                             Object JavaDoc arg12,
471                             ContextManager cm)
472                                 throws StandardException
473     {
474         QueryTreeNode retval = getNode(nodeType, cm);
475
476         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
477                     arg10, arg11, arg12);
478
479         return retval;
480     }
481     /**
482      * Get a node that takes thirteen initializer arguments.
483      *
484      * @param nodeType Identifier for the type of node.
485      * @param arg1 An initializer argument
486      * @param arg2 An initializer argument
487      * @param arg3 An initializer argument
488      * @param arg4 An initializer argument
489      * @param arg5 An initializer argument
490      * @param arg6 An initializer argument
491      * @param arg7 An initializer argument
492      * @param arg8 An initializer argument
493      * @param arg9 An initializer argument
494      * @param arg10 An initializer argument
495      * @param arg11 An initializer argument
496      * @param arg12 An initializer argument
497      * @param arg13 An initializer argument
498      * @param cm A ContextManager
499      *
500      * @return A new QueryTree node.
501      *
502      * @exception StandardException Thrown on error.
503      */

504     public final QueryTreeNode getNode(int nodeType,
505                             Object JavaDoc arg1,
506                             Object JavaDoc arg2,
507                             Object JavaDoc arg3,
508                             Object JavaDoc arg4,
509                             Object JavaDoc arg5,
510                             Object JavaDoc arg6,
511                             Object JavaDoc arg7,
512                             Object JavaDoc arg8,
513                             Object JavaDoc arg9,
514                             Object JavaDoc arg10,
515                             Object JavaDoc arg11,
516                             Object JavaDoc arg12,
517                             Object JavaDoc arg13,
518                             ContextManager cm)
519                                 throws StandardException
520     {
521         QueryTreeNode retval = getNode(nodeType, cm);
522
523         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
524                     arg10, arg11, arg12, arg13);
525
526         return retval;
527     }
528     /**
529      * Get a node that takes fourteen initializer arguments.
530      *
531      * @param nodeType Identifier for the type of node.
532      * @param arg1 An initializer argument
533      * @param arg2 An initializer argument
534      * @param arg3 An initializer argument
535      * @param arg4 An initializer argument
536      * @param arg5 An initializer argument
537      * @param arg6 An initializer argument
538      * @param arg7 An initializer argument
539      * @param arg8 An initializer argument
540      * @param arg9 An initializer argument
541      * @param arg10 An initializer argument
542      * @param arg11 An initializer argument
543      * @param arg12 An initializer argument
544      * @param arg13 An initializer argument
545      * @param arg14 An initializer argument
546      * @param cm A ContextManager
547      *
548      * @return A new QueryTree node.
549      *
550      * @exception StandardException Thrown on error.
551      */

552     public final QueryTreeNode getNode(int nodeType,
553                             Object JavaDoc arg1,
554                             Object JavaDoc arg2,
555                             Object JavaDoc arg3,
556                             Object JavaDoc arg4,
557                             Object JavaDoc arg5,
558                             Object JavaDoc arg6,
559                             Object JavaDoc arg7,
560                             Object JavaDoc arg8,
561                             Object JavaDoc arg9,
562                             Object JavaDoc arg10,
563                             Object JavaDoc arg11,
564                             Object JavaDoc arg12,
565                             Object JavaDoc arg13,
566                             Object JavaDoc arg14,
567                             ContextManager cm)
568                                 throws StandardException
569     {
570         QueryTreeNode retval = getNode(nodeType, cm);
571
572         retval.init(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
573                     arg10, arg11, arg12, arg13, arg14);
574
575         return retval;
576     }
577
578     /**
579      * Get one of the several types of create alias nodes. Carved out of parser
580      * so this could be used by ALTER PUBLICATION.
581      *
582      * @param aliasName The name of the alias
583      * @param targetName The full path/method name
584      * @param aliasSpecificInfo The full path of the target method name,
585      * if any
586      * @param aliasType The type of alias to create
587      * @param delimitedIdentifier Whether or not to treat the class name
588      * as a delimited identifier if trying to
589      * resolve it as a class alias.
590      * @param cm A ContextManager
591      *
592      * @return A CreateAliasNode matching the given parameters
593      *
594      * @exception StandardException Thrown on error
595      */

596     public abstract QueryTreeNode
597     getCreateAliasNode(
598         Object JavaDoc aliasName,
599         Object JavaDoc targetName,
600         Object JavaDoc aliasSpecificInfo,
601         char aliasType,
602         Boolean JavaDoc delimitedIdentifier,
603         ContextManager cm)
604         throws StandardException;
605
606     
607     /**
608      * Return a correctly configured node that represents
609      * a scan from a VTI dervied from the TableDesciptor.
610      * Used to convert from system diagnostic tables
611      * to VTI scans.
612      * @param td Table that is really a vti
613      * @param vtiClass Java class name for virtual table
614      * @param correlationName Correlation name of table clause
615      * @param resultColumns Columns extracted from table.
616      * @param tableProperties Properties being passed onto the table scan
617      * @param cm Current context manager
618      */

619     public abstract ResultSetNode mapTableAsVTI(
620             TableDescriptor td,
621             String JavaDoc vtiClass,
622             String JavaDoc correlationName,
623             ResultColumnList resultColumns,
624             Properties JavaDoc tableProperties,
625             ContextManager cm) throws StandardException;
626
627 }
628
629
Popular Tags