Default column length for a VARCHAR type

Hi,

I can’t seem to determine a default length for the Varchar type.

In Oracle8iDialect it is defined in registerCharacterTypeMappings with a variable which is informed by @Column (length) and which takes as default Column#DEFAULT_LENGTH

How can I give it another default value than 255, if possible?

	protected void registerCharacterTypeMappings() {
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, 4000, "varchar2($l)" );
		registerColumnType( Types.VARCHAR, "long" );
	}
package org.hibernate.mapping;

public class Column implements Selectable, Serializable, Cloneable {

	public static final int DEFAULT_LENGTH = 255;

I think it should be possible to add registerColumnType( Types.VARCHAR, 255, "varchar2(1234)" ); to do what you want, as this essentially means that, if the length is less than or equal to 255, then use this SQL type.

Changing the default is not really possible as that is mandated more or less by JPA through the @Column annotation.

registerColumnType allows you to set the maximum size if I’m not mistaken.

Ok a priori it is frozen by Column. Thank you.