01: /*
02: * Copyright 2006 Le Duc Bao, Ralf Joachim
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package org.castor.ddlgen;
17:
18: import org.castor.ddlgen.schemaobject.Field;
19: import org.castor.ddlgen.schemaobject.ForeignKey;
20: import org.castor.ddlgen.schemaobject.Index;
21: import org.castor.ddlgen.schemaobject.PrimaryKey;
22: import org.castor.ddlgen.schemaobject.Schema;
23: import org.castor.ddlgen.schemaobject.Table;
24:
25: /**
26: * The SchemaFactory handles the creation for various schema objects. It helps the
27: * AbstractGenerator to dynamically extract schema information for specific database.
28: * This interface need to be implemented for every supported database engine.
29: *
30: * @author <a href="mailto:leducbao AT gmail DOT com">Le Duc Bao</a>
31: * @author <a href="mailto:ralf DOT joachim AT syscon DOT eu">Ralf Joachim</a>
32: * @version $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
33: * @since 1.1
34: */
35: public interface SchemaFactory {
36: //--------------------------------------------------------------------------
37:
38: /**
39: * Create schema objects.
40: *
41: * @return New schema object.
42: */
43: Schema createSchema();
44:
45: /**
46: * Create table objects.
47: *
48: * @return New table object.
49: */
50: Table createTable();
51:
52: /**
53: * Create field objects.
54: *
55: * @return New field object.
56: */
57: Field createField();
58:
59: /**
60: * Create foreign key objects.
61: *
62: * @return New foreign key object.
63: */
64: ForeignKey createForeignKey();
65:
66: /**
67: * Create index objects.
68: *
69: * @return New index object.
70: */
71: Index createIndex();
72:
73: /**
74: * Create primary key objects.
75: *
76: * @return New primary key object.
77: */
78: PrimaryKey createPrimaryKey();
79:
80: //--------------------------------------------------------------------------
81: }
|