KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > sqls > SQLFactory


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

17 package org.apache.ws.jaxme.sqls;
18
19 import java.sql.Connection JavaDoc;
20 import java.sql.SQLException JavaDoc;
21 import java.util.Iterator JavaDoc;
22
23
24 /** <p>A factory for generating SQL statements.</p>
25  *
26  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
27  */

28 public interface SQLFactory {
29   public interface Ident {
30     /** <p>Returns the SQL identifiers String representation. Typically
31      * same than {@link Object#toString()}.</p>
32      */

33     public String JavaDoc getName();
34   }
35
36   /** <p>Returns the object factory being used.</p>
37    */

38   public ObjectFactory getObjectFactory();
39
40   /** <p>Returns the maximum length of a table name.</p>
41    *
42    * @return The maximum length or null, if checks for valid table name
43    * length are disabled.
44    */

45   public Integer JavaDoc getMaxTableNameLength();
46
47   /** <p>Returns whether table names are case sensitive or not. Defaults to
48    * false.</p>
49    */

50   public boolean isTableNameCaseSensitive();
51
52   /** <p>Returns the maximum length of a schema name.</p>
53    *
54    * @return The maximum length or null, if checks for valid schema name
55    * length are disabled.
56    */

57   public Integer JavaDoc getMaxSchemaNameLength();
58
59   /** <p>Returns whether schema names are case sensitive or not. Defaults to
60    * false.</p>
61    */

62   public boolean isSchemaNameCaseSensitive();
63
64   /** <p>Returns the maximum length of a column name.</p>
65    *
66    * @return The maximum length or null, if checks for valid column name
67    * length are disabled.
68    */

69   public Integer JavaDoc getMaxColumnNameLength();
70
71   /** <p>Returns whether column names are case sensitive or not. Defaults to
72    * false.</p>
73    */

74   public boolean isColumnNameCaseSensitive();
75
76   /** <p>Creates a new SELECT statement.</p>
77    */

78   public SelectStatement newSelectStatement();
79
80   /** <p>Creates a new INSERT statement.</p>
81    */

82   public InsertStatement newInsertStatement();
83
84   /** <p>Creates a new UPDATE statement.</p>
85    */

86   public UpdateStatement newUpdateStatement();
87
88   /** <p>Creates a new DELETE statement.</p>
89    */

90   public DeleteStatement newDeleteStatement();
91
92   /** <p>Creates a new {@link Schema} with the given name.</p>
93    */

94   public Schema newSchema(String JavaDoc pName);
95
96   /** <p>Creates a new {@link Schema} with the given name.</p>
97    */

98   public Schema newSchema(Schema.Name pName);
99
100   /** <p>Returns the {@link Schema Default schema}. The default
101    * schema has the name null.</p>
102    */

103   public Schema getDefaultSchema();
104
105   /** <p>Returns the schema with the given name or null, if no such
106    * schema exists.</p>
107    */

108   public Schema getSchema(Schema.Name pName);
109
110   /** <p>Returns the schema with the given name or null, if no such
111    * schema exists.</p>
112    */

113   public Schema getSchema(String JavaDoc pName);
114
115   /** <p>Returns a list of all schemas. The list includes the default
116    * schema, if {@link #getDefaultSchema()} was called at any time.</p>
117    */

118   public Iterator JavaDoc getSchemas();
119
120   /** <p>Creates a new {@link SQLGenerator}.</p>
121    */

122   public SQLGenerator newSQLGenerator();
123
124   /** <p>Reads the schema named <code>pName</code> from the database.</p>
125    */

126   public Schema getSchema(Connection JavaDoc pConnection, Schema.Name pName) throws SQLException JavaDoc;
127
128   /** <p>Reads the schema named <code>pName</code> from the database.</p>
129    */

130   public Schema getSchema(Connection JavaDoc pConnection, String JavaDoc pName) throws SQLException JavaDoc;
131
132   /** <p>Reads the table named <code>pTable</code> from the schema
133    * named <code>pSchema</code> in the database.</p>
134    */

135   public Table getTable(Connection JavaDoc pConnection, Schema.Name pSchema, Table.Name pTable) throws SQLException JavaDoc;
136
137   /** <p>Reads the table named <code>pTable</code> from the schema
138    * named <code>pSchema</code> in the database.</p>
139    */

140   public Table getTable(Connection JavaDoc pConnection, String JavaDoc pSchema,String JavaDoc pTable) throws SQLException JavaDoc;
141 }
142
Popular Tags