KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: PointbaseDialect.java,v 1.3 2004/10/26 15:41:00 oneovthafew Exp $
2
//Created on 04 February 2002, 17:35
3
package org.hibernate.dialect;
4
5 import java.sql.Types JavaDoc;
6
7 /**
8  * A <tt>Dialect</tt> for Pointbase.
9  * @author Ed Mackenzie
10  */

11 public class PointbaseDialect extends org.hibernate.dialect.Dialect {
12
13     /**
14      * Creates new PointbaseDialect
15      */

16     public PointbaseDialect() {
17         super();
18         registerColumnType( Types.BIT, "smallint" ); //no pointbase BIT
19
registerColumnType( Types.BIGINT, "bigint" );
20         registerColumnType( Types.SMALLINT, "smallint" );
21         registerColumnType( Types.TINYINT, "smallint" ); //no pointbase TINYINT
22
registerColumnType( Types.INTEGER, "integer" );
23         registerColumnType( Types.CHAR, "char(1)" );
24         registerColumnType( Types.VARCHAR, "varchar($l)" );
25         registerColumnType( Types.FLOAT, "float" );
26         registerColumnType( Types.DOUBLE, "double precision" );
27         registerColumnType( Types.DATE, "date" );
28         registerColumnType( Types.TIME, "time" );
29         registerColumnType( Types.TIMESTAMP, "timestamp" );
30         //the BLOB type requires a size arguement - this defaults to
31
//bytes - no arg defaults to 1 whole byte!
32
//other argument mods include K - kilobyte, M - megabyte, G - gigabyte.
33
//refer to the PBdevelopers guide for more info.
34
registerColumnType( Types.VARBINARY, "blob($l)" );
35         registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
36     }
37
38     public String JavaDoc getAddColumnString() {
39         return "add";
40     }
41
42     public boolean dropConstraints() {
43         return false;
44     }
45
46     public String JavaDoc getCascadeConstraintsString() {
47         return " cascade";
48     }
49
50     public String JavaDoc getForUpdateString() {
51         return "";
52     }
53
54 }
55
56
57
58
59
60
61
62
Popular Tags