KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > parsing > QueryNode


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.parsing;
23
24 import oracle.toplink.essentials.queryframework.*;
25 import oracle.toplink.essentials.expressions.*;
26
27 /**
28  * INTERNAL:
29  * This node contains the information about what kind of query is represented it's tree
30  * (e.g. Select, Update etc.)
31  * Subclasses of this node will contain query specific behavior.
32  */

33 public abstract class QueryNode extends MajorNode {
34     private ParseTree parseTree;
35
36     public QueryNode() {
37         super();
38     }
39
40     /**
41      * INTERNAL
42      * Apply this node to the passed query
43      */

44     public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);
45
46     /**
47      * INTERNAL
48      * Return a TopLink expression generated using the left node
49      */

50     public abstract Expression generateExpression(GenerationContext context);
51
52
53   /**
54    * Compute the Reference class for this query
55    * @param context
56    * @return the class this query is querying for
57    */

58     public Class JavaDoc getReferenceClass(GenerationContext genContext) {
59         return resolveClass(genContext);
60     }
61
62     public boolean isSelectNode() {
63         return false;
64     }
65
66     public boolean isUpdateNode() {
67         return false;
68     }
69
70     public boolean isDeleteNode() {
71         return false;
72     }
73
74     /**
75      * Return the class represented in this node.
76      */

77     public abstract Class JavaDoc resolveClass(GenerationContext context);
78
79     /**
80      * Set the parseTree
81      */

82     public void setParseTree(ParseTree parseTree) {
83         this.parseTree = parseTree;
84     }
85
86     /** */
87     public ParseTree getParseTree() {
88         return parseTree;
89     }
90     
91 }
92
Popular Tags