1 package org.apache.torque.engine.platform;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 239626 2005-08-24 12:19:51Z henning $
27 */
28 public interface Platform
29 {
30 /*** constant for native id method */
31 static final String IDENTITY = "identity";
32 /*** constant for native id method */
33 static final String SEQUENCE = "sequence";
34
35 /***
36 * Returns the native IdMethod (sequence|identity)
37 *
38 * @return the native IdMethod
39 */
40 String 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 getNullString(boolean notNull);
62
63 /***
64 * @return The RDBMS-specific SQL fragment for autoincrement.
65 */
66 String 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 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 sqlType);
83 }