KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: GenericDialect.java,v 1.3 2004/09/27 03:17:45 oneovthafew Exp $
2
package org.hibernate.dialect;
3
4 import java.sql.Types JavaDoc;
5
6
7 /**
8  * A generic SQL dialect which may or may not work on any actual databases
9  * @author Gavin King
10  */

11 public class GenericDialect extends Dialect {
12
13     public GenericDialect() {
14         super();
15         registerColumnType( Types.BIT, "bit" );
16         registerColumnType( Types.BIGINT, "bigint" );
17         registerColumnType( Types.SMALLINT, "smallint" );
18         registerColumnType( Types.TINYINT, "tinyint" );
19         registerColumnType( Types.INTEGER, "integer" );
20         registerColumnType( Types.CHAR, "char(1)" );
21         registerColumnType( Types.VARCHAR, "varchar($l)" );
22         registerColumnType( Types.FLOAT, "float" );
23         registerColumnType( Types.DOUBLE, "double" );
24         registerColumnType( Types.DATE, "date" );
25         registerColumnType( Types.TIME, "time" );
26         registerColumnType( Types.TIMESTAMP, "timestamp" );
27         registerColumnType( Types.VARBINARY, "varbinary($l)" );
28         registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
29         registerColumnType( Types.BLOB, "blob" );
30         registerColumnType( Types.CLOB, "clob" );
31     }
32
33 }
34
35
36
37
38
39
40
Popular Tags