KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: IngresDialect.java,v 1.8 2005/04/13 04:44:34 oneovthafew Exp $
2
package org.hibernate.dialect;
3
4 import java.sql.Types JavaDoc;
5
6 import org.hibernate.Hibernate;
7 import org.hibernate.dialect.function.VarArgsSQLFunction;
8
9
10 /**
11  * An Ingres SQL dialect
12  * @author Ian Booth
13  */

14 public class IngresDialect extends Dialect {
15
16     public IngresDialect() {
17         super();
18         registerColumnType( Types.BIT, "byte" );
19         registerColumnType( Types.BIGINT, "integer4" );
20         registerColumnType( Types.SMALLINT, "integer2" );
21         registerColumnType( Types.TINYINT, "integer1" );
22         registerColumnType( Types.INTEGER, "integer4" );
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, "date" );
29         registerColumnType( Types.TIMESTAMP, "date" );
30         registerColumnType( Types.VARBINARY, "varbinary($l)" );
31         registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
32         registerColumnType( Types.BLOB, "long varchar" );
33         registerColumnType( Types.CLOB, "long varchar" );
34         registerColumnType( Types.VARBINARY, "long varchar" );
35
36         registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "concat(","||",")" ) );
37     }
38
39     public String JavaDoc getAddColumnString() {
40         return "add column";
41     }
42
43     /**
44      * Do we need to drop constraints before dropping tables in this dialect?
45      * @return boolean
46      */

47     public boolean dropConstraints() {
48         return false;
49     }
50
51     public String JavaDoc getLowercaseFunction() {
52         return "lowercase";
53     }
54
55 }
56
Popular Tags