KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > ejb > query > DeleteNode


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.ejb.query;
13
14 /**
15  * DELETE FROM.
16  */

17 public class DeleteNode extends Node {
18
19     private String JavaDoc schemaName;
20     private String JavaDoc identifier;
21     private Node where;
22
23     public DeleteNode(String JavaDoc schemaName, String JavaDoc identifier, Node where) {
24         this.schemaName = schemaName;
25         this.identifier = identifier;
26         this.where = where;
27     }
28
29     public String JavaDoc getSchemaName() {
30         return schemaName;
31     }
32
33     public String JavaDoc getIdentifier() {
34         return identifier;
35     }
36
37     public Node getWhere() {
38         return where;
39     }
40
41     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
42         return v.arriveDeleteNode(this, msg);
43     }
44
45     public String JavaDoc toStringImp() {
46         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
47         s.append("UPDATE ");
48         s.append(schemaName);
49         s.append(" AS ");
50         s.append(identifier);
51         if (where != null) {
52             s.append("\nWHERE ");
53             s.append(where);
54         }
55         return s.toString();
56     }
57
58     public void resolve(ResolveContext rc) {
59         if (where != null) {
60             where.resolve(rc);
61         }
62     }
63
64 }
65
66
Popular Tags