KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: FrontBaseDialect.java,v 1.5 2004/10/26 15:41:00 oneovthafew Exp $
2
package org.hibernate.dialect;
3
4 import java.sql.Types JavaDoc;
5
6 /**
7  * An SQL Dialect for Frontbase. Assumes you're using the latest version
8  * of the FrontBase JDBC driver, available from <tt>http://frontbase.com/</tt>
9  * <p>
10  * <b>NOTE</b>: The latest JDBC driver is not always included with the
11  * latest release of FrontBase. Download the driver separately, and enjoy
12  * the informative release notes.
13  * <p>
14  * This dialect was tested with JDBC driver version 2.3.1. This driver
15  * contains a bug that causes batches of updates to fail. (The bug should be
16  * fixed in the next release of the JDBC driver.) If you are using JDBC driver
17  * 2.3.1, you can work-around this problem by setting the following in your
18  * <tt>hibernate.properties</tt> file: <tt>hibernate.jdbc.batch_size=15</tt>
19  *
20  * @author Ron Lussier <tt>rlussier@lenscraft.com</tt>
21  */

22 public class FrontBaseDialect extends Dialect {
23
24     public FrontBaseDialect() {
25         super();
26
27         registerColumnType( Types.BIT, "bit" );
28         registerColumnType( Types.BIGINT, "longint" );
29         registerColumnType( Types.SMALLINT, "smallint" );
30         registerColumnType( Types.TINYINT, "tinyint" );
31         registerColumnType( Types.INTEGER, "integer" );
32         registerColumnType( Types.CHAR, "char(1)" );
33         registerColumnType( Types.VARCHAR, "varchar($l)" );
34         registerColumnType( Types.FLOAT, "float" );
35         registerColumnType( Types.DOUBLE, "double precision" );
36         registerColumnType( Types.DATE, "date" );
37         registerColumnType( Types.TIME, "time" );
38         registerColumnType( Types.TIMESTAMP, "timestamp" );
39         registerColumnType( Types.VARBINARY, "bit varying($l)" );
40         registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
41         registerColumnType( Types.BLOB, "blob" );
42         registerColumnType( Types.CLOB, "clob" );
43     }
44
45     public String JavaDoc getAddColumnString() {
46         return "add column";
47     }
48
49     public String JavaDoc getCascadeConstraintsString() {
50         return " cascade";
51     }
52
53     public boolean dropConstraints() {
54         return false;
55     }
56
57     /**
58      * Does this dialect support the <tt>FOR UPDATE</tt> syntax. No!
59      *
60      * @return false always. FrontBase doesn't support this syntax,
61      * which was dropped with SQL92
62      */

63     public String JavaDoc getForUpdateString() {
64         return "";
65     }
66
67 }
68
Popular Tags