KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > dialect > JDataStoreDialect


1 // $Id: JDataStoreDialect.java,v 1.1 2005/06/08 07:06:50 oneovthafew Exp $
2
package org.hibernate.dialect;
3
4 import java.sql.Types JavaDoc;
5
6 import org.hibernate.cfg.Environment;
7
8 /**
9  * A <tt>Dialect</tt> for JDataStore.
10  *
11  * @author Vishy Kasar
12  */

13 public class JDataStoreDialect extends Dialect {
14
15     /**
16      * Creates new JDataStoreDialect
17      */

18     public JDataStoreDialect() {
19         super();
20
21         registerColumnType( Types.BIT, "tinyint" );
22         registerColumnType( Types.BIGINT, "bigint" );
23         registerColumnType( Types.SMALLINT, "smallint" );
24         registerColumnType( Types.TINYINT, "tinyint" );
25         registerColumnType( Types.INTEGER, "integer" );
26         registerColumnType( Types.CHAR, "char(1)" );
27         registerColumnType( Types.VARCHAR, "varchar($l)" );
28         registerColumnType( Types.FLOAT, "float" );
29         registerColumnType( Types.DOUBLE, "double" );
30         registerColumnType( Types.DATE, "date" );
31         registerColumnType( Types.TIME, "time" );
32         registerColumnType( Types.TIMESTAMP, "timestamp" );
33         registerColumnType( Types.VARBINARY, "varbinary($l)" );
34         registerColumnType( Types.NUMERIC, "numeric($p, $s)" );
35
36         registerColumnType( Types.BLOB, "varbinary" );
37         registerColumnType( Types.CLOB, "varchar" );
38
39         getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
40     }
41
42     public String JavaDoc getAddColumnString() {
43         return "add";
44     }
45
46     public boolean dropConstraints() {
47         return false;
48     }
49
50     public String JavaDoc getCascadeConstraintsString() {
51         return " cascade";
52     }
53
54     public boolean supportsIdentityColumns() {
55         return true;
56     }
57
58     public String JavaDoc getIdentitySelectString() {
59         return null; // NOT_SUPPORTED_SHOULD_USE_JDBC3_PreparedStatement.getGeneratedKeys_method
60
}
61
62     public String JavaDoc getIdentityColumnString() {
63         return "autoincrement";
64     }
65
66     public String JavaDoc getNoColumnsInsertString() {
67         return "default values";
68     }
69
70     public boolean supportsColumnCheck() {
71         return false;
72     }
73
74     public boolean supportsTableCheck() {
75         return false;
76     }
77
78 }
79
Popular Tags