FileDocCategorySizeDatePackage
MckoiDialect.javaAPI DocHibernate 3.2.53597Thu Feb 23 10:32:48 GMT 2006org.hibernate.dialect

MckoiDialect

public class MckoiDialect extends Dialect
An SQL dialect compatible with McKoi SQL
author
Doug Currie, Gabe Hicks

Fields Summary
Constructors Summary
public MckoiDialect()

		super();
		registerColumnType( Types.BIT, "bit" );
		registerColumnType( Types.BIGINT, "bigint" );
		registerColumnType( Types.SMALLINT, "smallint" );
		registerColumnType( Types.TINYINT, "tinyint" );
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		registerColumnType( Types.VARBINARY, "varbinary" );
		registerColumnType( Types.NUMERIC, "numeric" );
		registerColumnType( Types.BLOB, "blob" );
		registerColumnType( Types.CLOB, "clob" );

		registerFunction( "upper", new StandardSQLFunction("upper") );
		registerFunction( "lower", new StandardSQLFunction("lower") );
		registerFunction( "sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
		registerFunction( "abs", new StandardSQLFunction("abs") );
		registerFunction( "sign", new StandardSQLFunction( "sign", Hibernate.INTEGER ) );
		registerFunction( "length", new StandardSQLFunction( "length", Hibernate.INTEGER ) );
		registerFunction( "round", new StandardSQLFunction( "round", Hibernate.INTEGER ) );
		registerFunction( "mod", new StandardSQLFunction( "mod", Hibernate.INTEGER ) );
		registerFunction( "least", new StandardSQLFunction("least") );
		registerFunction( "greatest", new StandardSQLFunction("greatest") );
		registerFunction( "user", new StandardSQLFunction( "user", Hibernate.STRING ) );
		registerFunction( "concat", new StandardSQLFunction( "concat", Hibernate.STRING ) );

		getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
	
Methods Summary
public org.hibernate.sql.CaseFragmentcreateCaseFragment()

		return new MckoiCaseFragment();
	
public java.lang.StringgetAddColumnString()

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

		return "create sequence " + sequenceName;
	
public java.lang.StringgetDropSequenceString(java.lang.String sequenceName)

		return "drop sequence " + sequenceName;
	
public java.lang.StringgetForUpdateString()

		return "";
	
public org.hibernate.dialect.lock.LockingStrategygetLockingStrategy(org.hibernate.persister.entity.Lockable lockable, org.hibernate.LockMode lockMode)

		// Mckoi has no known variation of a "SELECT ... FOR UPDATE" syntax...
		if ( lockMode.greaterThan( LockMode.READ ) ) {
			return new UpdateLockingStrategy( lockable, lockMode );
		}
		else {
			return new SelectLockingStrategy( lockable, lockMode );
		}
	
public java.lang.StringgetSelectSequenceNextValString(java.lang.String sequenceName)

		return "nextval('" + sequenceName + "')";
	
public java.lang.StringgetSequenceNextValString(java.lang.String sequenceName)

		return "select " + getSelectSequenceNextValString( sequenceName );
	
public booleansupportsSequences()

		return true;