01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.ejb.query;
12:
13: /**
14: * DELETE FROM.
15: */
16: public class DeleteNode extends Node {
17:
18: private String schemaName;
19: private String identifier;
20: private Node where;
21:
22: public DeleteNode(String schemaName, String identifier, Node where) {
23: this .schemaName = schemaName;
24: this .identifier = identifier;
25: this .where = where;
26: }
27:
28: public String getSchemaName() {
29: return schemaName;
30: }
31:
32: public String getIdentifier() {
33: return identifier;
34: }
35:
36: public Node getWhere() {
37: return where;
38: }
39:
40: public Object arrive(NodeVisitor v, Object msg) {
41: return v.arriveDeleteNode(this , msg);
42: }
43:
44: public String toStringImp() {
45: StringBuffer s = new StringBuffer();
46: s.append("UPDATE ");
47: s.append(schemaName);
48: s.append(" AS ");
49: s.append(identifier);
50: if (where != null) {
51: s.append("\nWHERE ");
52: s.append(where);
53: }
54: return s.toString();
55: }
56:
57: public void resolve(ResolveContext rc) {
58: if (where != null) {
59: where.resolve(rc);
60: }
61: }
62:
63: }
|