Java Code Examples for org.hibernate.type.descriptor.sql.VarcharTypeDescriptor

The following examples show how to use org.hibernate.type.descriptor.sql.VarcharTypeDescriptor. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public ClobType(Dialect dialect) {
	super(new VarcharTypeDescriptor() {
		@Override
		public int getSqlType() {
			//force the use of byte instead of oid on Postgres
			return dialect instanceof PostgreSQL10Dialect
					? Types.LONGVARCHAR
					: Types.CLOB;
		}

		@Override
		public boolean canBeRemapped() {
			return false;
		}
	}, StringTypeDescriptor.INSTANCE);
}
 
Example 2
Source Project: lams   Source File: DB297Dialect.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	// See HHH-12753
	// It seems that DB2's JDBC 4.0 support as of 9.5 does not support the N-variant methods like
	// NClob or NString.  Therefore here we overwrite the sql type descriptors to use the non-N variants
	// which are supported.
	switch ( sqlCode ) {
		case Types.NCHAR:
			return CharTypeDescriptor.INSTANCE;

		case Types.NCLOB:
			if ( useInputStreamToInsertBlob() ) {
				return ClobTypeDescriptor.STREAM_BINDING;
			}
			else {
				return ClobTypeDescriptor.CLOB_BINDING;
			}

		case Types.NVARCHAR:
			return VarcharTypeDescriptor.INSTANCE;

		default:
			return super.getSqlTypeDescriptorOverride( sqlCode );
	}
}
 
Example 3
Source Project: lams   Source File: AbstractHANADialect.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(final int sqlCode) {
	switch ( sqlCode ) {
		case Types.CLOB:
			return this.clobTypeDescriptor;
		case Types.NCLOB:
			return this.nClobTypeDescriptor;
		case Types.BLOB:
			return this.blobTypeDescriptor;
		case Types.TINYINT:
			// tinyint is unsigned on HANA
			return SmallIntTypeDescriptor.INSTANCE;
		case Types.BOOLEAN:
			return this.useLegacyBooleanType ? BitTypeDescriptor.INSTANCE : BooleanTypeDescriptor.INSTANCE;
		case Types.VARCHAR:
			return this.useUnicodeStringTypes ? NVarcharTypeDescriptor.INSTANCE : VarcharTypeDescriptor.INSTANCE;
		case Types.CHAR:
			return this.useUnicodeStringTypes ? NCharTypeDescriptor.INSTANCE : CharTypeDescriptor.INSTANCE;
		default:
			return super.getSqlTypeDescriptorOverride( sqlCode );
	}
}
 
Example 4
Source Project: hibernate-types   Source File: ZoneIdType.java    License: Apache License 2.0 5 votes vote down vote up
public ZoneIdType(Configuration configuration) {
    super(
        VarcharTypeDescriptor.INSTANCE,
        ZoneIdTypeDescriptor.INSTANCE,
        configuration
    );
}
 
Example 5
public BitSetType() {
    super( VarcharTypeDescriptor.INSTANCE, BitSetTypeDescriptor.INSTANCE );
}
 
Example 6
public CommaDelimitedStringsType() {
    super(
        VarcharTypeDescriptor.INSTANCE,
        new CommaDelimitedStringsJavaTypeDescriptor()
    );
}
 
Example 7
Source Project: lams   Source File: ClassType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public ClassType() {
	super( VarcharTypeDescriptor.INSTANCE, ClassTypeDescriptor.INSTANCE );
}
 
Example 8
Source Project: lams   Source File: StringType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public StringType() {
	super( VarcharTypeDescriptor.INSTANCE, StringTypeDescriptor.INSTANCE );
}
 
Example 9
Source Project: lams   Source File: CharArrayType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public CharArrayType() {
	super( VarcharTypeDescriptor.INSTANCE, PrimitiveCharacterArrayTypeDescriptor.INSTANCE );
}
 
Example 10
Source Project: lams   Source File: CurrencyType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public CurrencyType() {
	super( VarcharTypeDescriptor.INSTANCE, CurrencyTypeDescriptor.INSTANCE );
}
 
Example 11
Source Project: lams   Source File: CharacterArrayType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public CharacterArrayType() {
	super( VarcharTypeDescriptor.INSTANCE, CharacterArrayTypeDescriptor.INSTANCE );
}
 
Example 12
Source Project: lams   Source File: UUIDCharType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public UUIDCharType() {
	super( VarcharTypeDescriptor.INSTANCE, UUIDTypeDescriptor.INSTANCE );
}
 
Example 13
Source Project: lams   Source File: TimeZoneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public TimeZoneType() {
	super( VarcharTypeDescriptor.INSTANCE, TimeZoneTypeDescriptor.INSTANCE );
}
 
Example 14
Source Project: lams   Source File: LocaleType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public LocaleType() {
	super( VarcharTypeDescriptor.INSTANCE, LocaleTypeDescriptor.INSTANCE );
}
 
Example 15
Source Project: lams   Source File: UrlType.java    License: GNU General Public License v2.0 4 votes vote down vote up
public UrlType() {
	super( VarcharTypeDescriptor.INSTANCE, UrlTypeDescriptor.INSTANCE );
}
 
Example 16
Source Project: hibernate-types   Source File: ZoneIdType.java    License: Apache License 2.0 4 votes vote down vote up
public ZoneIdType() {
    super(
        VarcharTypeDescriptor.INSTANCE,
        ZoneIdTypeDescriptor.INSTANCE
    );
}
 
Example 17
Source Project: tutorials   Source File: LocalDateStringType.java    License: MIT License 4 votes vote down vote up
public LocalDateStringType() {
    super(VarcharTypeDescriptor.INSTANCE, LocalDateStringJavaDescriptor.INSTANCE);
}
 
Example 18
Source Project: tutorials   Source File: LocalDateStringType.java    License: MIT License 4 votes vote down vote up
public LocalDateStringType() {
    super(VarcharTypeDescriptor.INSTANCE, LocalDateStringJavaDescriptor.INSTANCE);
}