InformixDialectpublic class InformixDialect extends Dialect Informix dialect.
Seems to work with Informix Dynamic Server Version 7.31.UD3,
Informix JDBC driver version 2.21JC3. |
Fields Summary |
---|
private static org.hibernate.exception.ViolatedConstraintNameExtracter | EXTRACTER |
Constructors Summary |
---|
public InformixDialect()Creates new InformixDialect instance. Sets up the JDBC /
Informix type mappings.
super();
registerColumnType(Types.BIGINT, "int8");
registerColumnType(Types.BINARY, "byte");
registerColumnType(Types.BIT, "smallint"); // Informix doesn't have a bit type
registerColumnType(Types.CHAR, "char($l)");
registerColumnType(Types.DATE, "date");
registerColumnType(Types.DECIMAL, "decimal");
registerColumnType(Types.DOUBLE, "float");
registerColumnType(Types.FLOAT, "smallfloat");
registerColumnType(Types.INTEGER, "integer");
registerColumnType(Types.LONGVARBINARY, "blob"); // or BYTE
registerColumnType(Types.LONGVARCHAR, "clob"); // or TEXT?
registerColumnType(Types.NUMERIC, "decimal"); // or MONEY
registerColumnType(Types.REAL, "smallfloat");
registerColumnType(Types.SMALLINT, "smallint");
registerColumnType(Types.TIMESTAMP, "datetime year to fraction(5)");
registerColumnType(Types.TIME, "datetime hour to second");
registerColumnType(Types.TINYINT, "smallint");
registerColumnType(Types.VARBINARY, "byte");
registerColumnType(Types.VARCHAR, "varchar($l)");
registerColumnType(Types.VARCHAR, 255, "varchar($l)");
registerColumnType(Types.VARCHAR, 32739, "lvarchar($l)");
registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );
|
Methods Summary |
---|
public java.lang.String | getAddColumnString()
return "add";
| public java.lang.String | getAddForeignKeyConstraintString(java.lang.String constraintName, java.lang.String[] foreignKey, java.lang.String referencedTable, java.lang.String[] primaryKey, boolean referencesPrimaryKey)The syntax used to add a foreign key constraint to a table.
Informix constraint name must be at the end.
StringBuffer result = new StringBuffer(30);
result.append(" add constraint ")
.append(" foreign key (")
.append( StringHelper.join(", ", foreignKey) )
.append(") references ")
.append(referencedTable);
if(!referencesPrimaryKey) {
result.append(" (")
.append( StringHelper.join(", ", primaryKey) )
.append(')");
}
result.append(" constraint ").append(constraintName);
return result.toString();
| public java.lang.String | getAddPrimaryKeyConstraintString(java.lang.String constraintName)The syntax used to add a primary key constraint to a table.
Informix constraint name must be at the end.
return " add constraint primary key constraint " + constraintName + " ";
| public java.lang.String | getCreateSequenceString(java.lang.String sequenceName)
return "create sequence " + sequenceName;
| public java.lang.String | getCurrentTimestampSelectString()
return "select distinct current timestamp from informix.systables";
| public java.lang.String | getDropSequenceString(java.lang.String sequenceName)
return "drop sequence " + sequenceName + " restrict";
| public java.lang.String | getIdentityColumnString(int type)
return type==Types.BIGINT ?
"serial8 not null" :
"serial not null";
| public java.lang.String | getIdentitySelectString(java.lang.String table, java.lang.String column, int type)
return type==Types.BIGINT ?
"select dbinfo('serial8') from systables where tabid=1" :
"select dbinfo('sqlca.sqlerrd1') from systables where tabid=1";
| public java.lang.String | getLimitString(java.lang.String querySelect, int offset, int limit)
if (offset>0) throw new UnsupportedOperationException("informix has no offset");
return new StringBuffer( querySelect.length()+8 )
.append(querySelect)
.insert( querySelect.toLowerCase().indexOf( "select" ) + 6, " first " + limit )
.toString();
| public java.lang.String | getSelectSequenceNextValString(java.lang.String sequenceName)
return sequenceName + ".nextval";
| public java.lang.String | getSequenceNextValString(java.lang.String sequenceName)
return "select " + getSelectSequenceNextValString( sequenceName ) + " from systables where tabid=1";
| public org.hibernate.exception.ViolatedConstraintNameExtracter | getViolatedConstraintNameExtracter()
return EXTRACTER;
| public boolean | hasDataTypeInIdentityColumn()
return false;
| public boolean | isCurrentTimestampSelectStringCallable()
return false;
| public boolean | supportsCurrentTimestampSelection()
return true;
| public boolean | supportsIdentityColumns()
return true;
| public boolean | supportsLimit()
return true;
| public boolean | supportsLimitOffset()
return false;
| public boolean | supportsSequences()
return true;
| public boolean | supportsVariableLimit()
return false;
| public boolean | useMaxForLimit()
return true;
|
|