KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > sqls > hsqldb > HsqlDbSQLFactoryImpl


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 package org.apache.ws.jaxme.sqls.hsqldb;
17
18 import org.apache.ws.jaxme.sqls.Column;
19 import org.apache.ws.jaxme.sqls.SQLGenerator;
20 import org.apache.ws.jaxme.sqls.Schema;
21 import org.apache.ws.jaxme.sqls.Table;
22 import org.apache.ws.jaxme.sqls.impl.SQLFactoryImpl;
23
24 /** <p>Default implementation of an SQL factory for HsqlDb databases.
25  * This factory ensures that the created implementations of
26  * {@link Schema}, {@link Table}, {@link Column}, and {@link SQLGenerator}
27  * may be casted to {@link HsqlDbSchema}, {@link HsqlDbTable}, {@link HsqlDbColumn},
28  * {@link HsqlDbSQLGenerator}, respectively.</p>
29  */

30 public class HsqlDbSQLFactoryImpl extends SQLFactoryImpl implements HsqlDbSQLFactory {
31    public Schema newSchemaImpl(Schema.Name pName) {
32      if (pName != null) {
33        throw new IllegalArgumentException JavaDoc("The HsqlDb database is supporting the default schema only.");
34      }
35      return new HsqlDbSchemaImpl(this, pName);
36    }
37
38    public Table newTableImpl(Schema pSchema, Table.Name pName) {
39      return new HsqlDbTableImpl(pSchema, pName);
40    }
41
42    public Column newColumn(Table pTable, Column.Name pName, Column.Type pType) {
43      return new HsqlDbColumnImpl(pTable, pName, pType);
44    }
45
46    public SQLGenerator newSQLGenerator() {
47      return new HsqlDbSQLGeneratorImpl();
48    }
49 }
50
Popular Tags