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

The following examples show how to use org.hibernate.type.descriptor.sql.VarcharTypeDescriptor#INSTANCE . 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
Source File: DB297Dialect.java    From lams with 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 2
Source File: AbstractHANADialect.java    From lams with 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 3
Source File: ZoneIdType.java    From hibernate-types with Apache License 2.0 5 votes vote down vote up
public ZoneIdType(Configuration configuration) {
    super(
        VarcharTypeDescriptor.INSTANCE,
        ZoneIdTypeDescriptor.INSTANCE,
        configuration
    );
}
 
Example 4
Source File: CharacterArrayType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public CharacterArrayType() {
	super( VarcharTypeDescriptor.INSTANCE, CharacterArrayTypeDescriptor.INSTANCE );
}
 
Example 5
Source File: LocalDateStringType.java    From tutorials with MIT License 4 votes vote down vote up
public LocalDateStringType() {
    super(VarcharTypeDescriptor.INSTANCE, LocalDateStringJavaDescriptor.INSTANCE);
}
 
Example 6
Source File: LocalDateStringType.java    From tutorials with MIT License 4 votes vote down vote up
public LocalDateStringType() {
    super(VarcharTypeDescriptor.INSTANCE, LocalDateStringJavaDescriptor.INSTANCE);
}
 
Example 7
Source File: ZoneIdType.java    From hibernate-types with Apache License 2.0 4 votes vote down vote up
public ZoneIdType() {
    super(
        VarcharTypeDescriptor.INSTANCE,
        ZoneIdTypeDescriptor.INSTANCE
    );
}
 
Example 8
Source File: UrlType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public UrlType() {
	super( VarcharTypeDescriptor.INSTANCE, UrlTypeDescriptor.INSTANCE );
}
 
Example 9
Source File: LocaleType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public LocaleType() {
	super( VarcharTypeDescriptor.INSTANCE, LocaleTypeDescriptor.INSTANCE );
}
 
Example 10
Source File: TimeZoneType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public TimeZoneType() {
	super( VarcharTypeDescriptor.INSTANCE, TimeZoneTypeDescriptor.INSTANCE );
}
 
Example 11
Source File: UUIDCharType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public UUIDCharType() {
	super( VarcharTypeDescriptor.INSTANCE, UUIDTypeDescriptor.INSTANCE );
}
 
Example 12
Source File: BitSetType.java    From google-cloud-spanner-hibernate with GNU Lesser General Public License v2.1 4 votes vote down vote up
public BitSetType() {
    super( VarcharTypeDescriptor.INSTANCE, BitSetTypeDescriptor.INSTANCE );
}
 
Example 13
Source File: CurrencyType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public CurrencyType() {
	super( VarcharTypeDescriptor.INSTANCE, CurrencyTypeDescriptor.INSTANCE );
}
 
Example 14
Source File: CharArrayType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public CharArrayType() {
	super( VarcharTypeDescriptor.INSTANCE, PrimitiveCharacterArrayTypeDescriptor.INSTANCE );
}
 
Example 15
Source File: StringType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public StringType() {
	super( VarcharTypeDescriptor.INSTANCE, StringTypeDescriptor.INSTANCE );
}
 
Example 16
Source File: ClassType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public ClassType() {
	super( VarcharTypeDescriptor.INSTANCE, ClassTypeDescriptor.INSTANCE );
}
 
Example 17
Source File: CommaDelimitedStringsType.java    From google-cloud-spanner-hibernate with GNU Lesser General Public License v2.1 4 votes vote down vote up
public CommaDelimitedStringsType() {
    super(
        VarcharTypeDescriptor.INSTANCE,
        new CommaDelimitedStringsJavaTypeDescriptor()
    );
}