FileDocCategorySizeDatePackage
InterbaseDialect.javaAPI DocHibernate 3.2.53149Wed Aug 03 18:29:32 BST 2005org.hibernate.dialect

InterbaseDialect

public class InterbaseDialect extends Dialect
An SQL dialect for Interbase.
author
Gavin King

Fields Summary
Constructors Summary
public InterbaseDialect()

		super();
		registerColumnType( Types.BIT, "smallint" );
		registerColumnType( Types.BIGINT, "numeric(18,0)" );
		registerColumnType( Types.SMALLINT, "smallint" );
		registerColumnType( Types.TINYINT, "smallint" );
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double precision" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		registerColumnType( Types.VARBINARY, "blob" );
		registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
		registerColumnType( Types.BLOB, "blob" );
		registerColumnType( Types.CLOB, "blob sub_type 1" );
		
		registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(","||",")" ) );

		getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
	
Methods Summary
public booleanbindLimitParametersFirst()

		return false;
	
public booleanbindLimitParametersInReverseOrder()

		return false;
	
public java.lang.StringgetAddColumnString()

		return "add";
	
public java.lang.StringgetCreateSequenceString(java.lang.String sequenceName)

		return "create generator " + sequenceName;
	
public java.lang.StringgetCurrentTimestampCallString()

		// TODO : not sure which (either?) is correct, could not find docs on how to do this.
		// did find various blogs and forums mentioning that select CURRENT_TIMESTAMP
		// does not work...
		return "{?= call CURRENT_TIMESTAMP }";
//		return "select CURRENT_TIMESTAMP from RDB$DATABASE";
	
public java.lang.StringgetDropSequenceString(java.lang.String sequenceName)

		return "delete from RDB$GENERATORS where RDB$GENERATOR_NAME = '" + sequenceName.toUpperCase() + "'";
	
public java.lang.StringgetForUpdateString()

		return " with lock";
	
public java.lang.StringgetForUpdateString(java.lang.String aliases)

		return " for update of " + aliases + " with lock";
	
public java.lang.StringgetLimitString(java.lang.String sql, boolean hasOffset)

		return new StringBuffer( sql.length()+15 )
			.append(sql)
			.append(hasOffset ? " rows ? to ?" : " rows ?")
			.toString();
	
public java.lang.StringgetQuerySequencesString()

		return "select RDB$GENERATOR_NAME from RDB$GENERATORS";
	
public java.lang.StringgetSelectSequenceNextValString(java.lang.String sequenceName)

		return "gen_id( " + sequenceName + ", 1 )";
	
public java.lang.StringgetSequenceNextValString(java.lang.String sequenceName)

		return "select " + getSelectSequenceNextValString( sequenceName ) + " from RDB$DATABASE";
	
public booleanisCurrentTimestampSelectStringCallable()

		return true;
	
public booleansupportsLimit()

		return true;
	
public booleansupportsSequences()

		return true;