Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect
In directory sc8-pr-cvs1:/tmp/cvs-serv12940
Modified Files:
FrontBaseDialect.java
Added Files:
InformixDialect.java
Log Message:
* added InformixDialect (Steve Molitor)
* FrontBase does not suport FOR UPDATE (Ron Lussier)
--- NEW FILE: InformixDialect.java ---
package net.sf.hibernate.dialect;
import java.sql.Types;
import net.sf.hibernate.MappingException;
/**
* Informix dialect. This class is required in order to use Hibernate with
* Informix.
*
* Seems to work with Informix Dynamic Server Version 7.31.UD3,
* Informix JDBC driver version 2.21JC3.
*/
public class InformixDialect extends Dialect {
/**
* Creates new <code>InformixDialect</code> instance. Sets up the JDBC /
* Informix type mappings.
*/
public InformixDialect() {
super();
register(Types.BIGINT, "INT8");
register(Types.BINARY, "BYTE");
register(Types.BIT, "SMALLINT"); // Informix doesn't have a bit type
register(Types.CHAR, "CHAR($l)");
register(Types.DATE, "DATE");
register(Types.DECIMAL, "DECIMAL");
register(Types.DOUBLE, "DOUBLE");
register(Types.FLOAT, "FLOAT");
register(Types.INTEGER, "INTEGER");
register(Types.LONGVARBINARY, "BLOB"); // or BYTE
register(Types.LONGVARCHAR, "CLOB"); // or TEXT?
register(Types.NUMERIC, "DECIMAL"); // or MONEY
register(Types.REAL, "SMALLFLOAT");
register(Types.SMALLINT, "SMALLINT");
register(Types.TIME, "DATETIME YEAR TO FRACTION(5)");
register(Types.TIMESTAMP, "DATETIME HOUR TO SECOND");
register(Types.TINYINT, "SMALLINT");
register(Types.VARBINARY, "BYTE");
register(Types.VARCHAR, "VARCHAR($l)");
}
/**
* @see net.sf.hibernate.dialect.Dialect#getAddColumnString()
* @deprecated
*/
public String getAddColumnString() {
return "add";
}
/**
* @see net.sf.hibernate.dialect.Dialect#supportsIdentityColumns()
*/
public boolean supportsIdentityColumns() {
return true;
}
/**
* @see net.sf.hibernate.dialect.Dialect#getIdentitySelectString()
*/
public String getIdentitySelectString() throws MappingException {
return "select first 1 dbinfo('sqlca.sqlerrd1') from systables";
}
/**
* @see net.sf.hibernate.dialect.Dialect#getIdentityColumnString()
*/
public String getIdentityColumnString() throws MappingException {
return "SERIAL NOT NULL";
}
}
Index: FrontBaseDialect.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/FrontBaseDialect.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FrontBaseDialect.java 1 Mar 2003 21:27:29 -0000 1.1
--- FrontBaseDialect.java 12 Apr 2003 02:09:43 -0000 1.2
***************
*** 4,8 ****
/**
! * An SQL Dialect for Frontbase.
*
* @author ron lussier - rlu...@le...
--- 4,19 ----
/**
! * An SQL Dialect for Frontbase. Assumes you're using the latest version
! * of the FrontBase JDBC driver, available from <tt>http://frontbase.com/</tt>
! * <p>
! * <b>NOTE</b>: The latest JDBC driver is not always included with the
! * latest release of FrontBase. Download the driver separately, and enjoy
! * the informative release notes.
! * <p>
! * This dialect was tested with JDBC driver version 2.3.1. This driver
! * contains a bug that causes batches of updates to fail. (The bug should be
! * fixed in the next release of the JDBC driver.) If you are using JDBC driver
! * 2.3.1, you can work-around this problem by setting the following in your
! * <tt>hibernate.properties</tt> file: <tt>hibernate.jdbc.batch_size=15</tt>
*
* @author ron lussier - rlu...@le...
***************
*** 38,40 ****
--- 49,63 ----
return " cascade";
}
+
+ /**
+ * Does this dialect support the <tt>FOR UPDATE</tt> syntax? No!
+ *
+ * @return false always. FrontBase doesn't support this syntax,
+ * which was dropped with SQL92
+ */
+ public boolean supportsForUpdate()
+ {
+ return false;
+ }
+
}
|