KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mckoi > database > interpret > FromTableInterface


1 /**
2  * com.mckoi.database.sql.FromTableInterface 20 Jul 2001
3  *
4  * Mckoi SQL Database ( http://www.mckoi.com/database )
5  * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * Version 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License Version 2 for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * Version 2 along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  * Change Log:
21  *
22  *
23  */

24
25 package com.mckoi.database.interpret;
26
27 import com.mckoi.database.*;
28
29 /**
30  * A single table resource item in a query which handles the behaviour
31  * of resolving references to columns as well as providing various base
32  * utility methods for resolving general variable names.
33  * <p>
34  * Each instance of this interface represents a single 'FROM' resource.
35  *
36  * @author Tobias Downer
37  */

38
39 public interface FromTableInterface {
40
41   /**
42    * Returns a unique name given to this table source. No other sources
43    * will share this identifier string.
44    */

45   String JavaDoc getUniqueName();
46
47   /**
48    * Returns true if this source will match the given catalog, schema and
49    * table. If any arguments are null then it is not included in the match.
50    * <p>
51    * Used for 'Part.*' type glob searches.
52    */

53   boolean matchesReference(String JavaDoc catalog, String JavaDoc schema, String JavaDoc table);
54
55   /**
56    * Returns the number of instances we can resolve the given catalog, schema,
57    * table and column name to a column or columns within this item. Note that
58    * if catalog, schema, table or column is 'null' then it means it doesn't
59    * matter.
60    * <p>
61    * For example, say we need to resolve the column 'id' the arguments are
62    * null, null, null, "id". This may resolve to multiple columns if there is
63    * a mixture of tables with "id" as a column.
64    * <p>
65    * Note that parameters of 'null, null, null, null',
66    * 'null, null, null, not null', 'null, null, not null, not null',
67    * 'null, not null, not null, not null', and
68    * 'not null, not null, not null, not null' are only accepted.
69    */

70   int resolveColumnCount(String JavaDoc catalog, String JavaDoc schema,
71                          String JavaDoc table, String JavaDoc column);
72
73   /**
74    * Returns a Variable that is a fully resolved form of the given column in
75    * this table set. This method does not have to check whether the parameters
76    * reference more than one column. If more than one column is referenced,
77    * the actual column returned is implementation specific.
78    */

79   Variable resolveColumn(String JavaDoc catalog, String JavaDoc schema,
80                          String JavaDoc table, String JavaDoc column);
81
82   /**
83    * Returns an array of Variable objects that references each column
84    * available in this table set item in order from left column to
85    * right column.
86    */

87   Variable[] allColumns();
88
89 // /**
90
// * Returns a Queriable object that can be evaluated to return a tangible
91
// * Table object to use in a query.
92
// * <p>
93
// * Note that this method would generally only be used at the end of the
94
// * lifespan of this instance.
95
// */
96
// Queriable getQueriable();
97

98 }
99
Popular Tags