1 package org.hibernate.dialect; 3 4 import java.sql.Types ; 5 6 import org.hibernate.Hibernate; 7 import org.hibernate.dialect.function.VarArgsSQLFunction; 8 9 10 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 getAddColumnString() { 40 return "add column"; 41 } 42 43 47 public boolean dropConstraints() { 48 return false; 49 } 50 51 public String getLowercaseFunction() { 52 return "lowercase"; 53 } 54 55 } 56 | Popular Tags |