KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > query > rdb > lib > BasicRdbQueryLeaf


1 /**
2  * Copyright (C) 2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package org.objectweb.medor.query.rdb.lib;
19
20 import org.objectweb.medor.datasource.api.DataStore;
21 import org.objectweb.medor.expression.api.Expression;
22 import org.objectweb.medor.query.lib.BasicQueryTree;
23 import org.objectweb.medor.query.rdb.api.RdbQueryLeaf;
24
25 import java.util.Map JavaDoc;
26
27 /**
28  *
29  * @author S.Chassande-Barrioz
30  */

31 public abstract class BasicRdbQueryLeaf
32     extends BasicQueryTree
33     implements RdbQueryLeaf {
34
35     protected boolean isSubquery = false;
36     protected Expression sqlFilter;
37     protected String JavaDoc query;
38     protected DataStore ds;
39
40     public BasicRdbQueryLeaf() {
41     }
42
43     public BasicRdbQueryLeaf(String JavaDoc _name,
44                              DataStore ds) {
45         super(_name);
46         this.ds = ds;
47     }
48
49     public BasicRdbQueryLeaf(String JavaDoc _name,
50                              DataStore ds,
51                              String JavaDoc query) {
52         super(_name);
53         this.ds = ds;
54         this.query = query;
55     }
56
57     public Object JavaDoc clone(Object JavaDoc clone,
58                         Map JavaDoc obj2clone) throws CloneNotSupportedException JavaDoc {
59         clone = super.clone(clone, obj2clone);
60         BasicRdbQueryLeaf ql = (BasicRdbQueryLeaf) clone;
61         ql.sqlFilter = (Expression) getClone(sqlFilter, obj2clone);
62         ql.ds = ds;
63         ql.query = query;
64         ql.isSubquery = isSubquery;
65         return clone;
66     }
67     public boolean isSubquery() {
68         return isSubquery;
69     }
70
71     public void setIsSubquery(boolean subquery) {
72         this.isSubquery = subquery;
73     }
74
75     public DataStore getDataStore() {
76         return ds;
77     }
78
79     public void setDataStore(DataStore ds) {
80         this.ds = ds;
81     }
82 }
83
Popular Tags