KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > torque > engine > platform > Platform


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

18
19 import org.apache.torque.engine.database.model.Domain;
20 import org.apache.torque.engine.database.model.SchemaType;
21
22 /**
23  * Interface for RDBMS platform specific behaviour.
24  *
25  * @author <a HREF="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
26  * @version $Id: Platform.java,v 1.8 2004/02/22 06:27:19 jmcnally Exp $
27  */

28 public interface Platform
29 {
30     /** constant for native id method */
31     static final String JavaDoc IDENTITY = "identity";
32     /** constant for native id method */
33     static final String JavaDoc SEQUENCE = "sequence";
34     
35     /**
36      * Returns the native IdMethod (sequence|identity)
37      *
38      * @return the native IdMethod
39      */

40     String JavaDoc getNativeIdMethod();
41
42     /**
43      * Returns the max column length supported by the db.
44      *
45      * @return the max column length
46      */

47     int getMaxColumnNameLength();
48
49     /**
50      * Returns the db specific domain for a jdbcType.
51      *
52      * @param jdbcType the jdbcType name
53      * @return the db specific domain
54      */

55     Domain getDomainForSchemaType(SchemaType jdbcType);
56     
57     /**
58      * @return The RDBMS-specific SQL fragment for <code>NULL</code>
59      * or <code>NOT NULL</code>.
60      */

61     String JavaDoc getNullString(boolean notNull);
62
63     /**
64      * @return The RDBMS-specific SQL fragment for autoincrement.
65      */

66     String JavaDoc getAutoIncrement();
67     
68     /**
69      * Returns if the RDBMS-specific SQL type has a size attribute.
70      *
71      * @param sqlType the SQL type
72      * @return true if the type has a size attribute
73      */

74     boolean hasSize(String JavaDoc sqlType);
75     
76     /**
77      * Returns if the RDBMS-specific SQL type has a scale attribute.
78      *
79      * @param sqlType the SQL type
80      * @return true if the type has a scale attribute
81      */

82     boolean hasScale(String JavaDoc sqlType);
83 }
84
Popular Tags