当前位置: 首页>>代码示例>>Java>>正文


Java SqlTypeDescriptor类代码示例

本文整理汇总了Java中org.hibernate.type.descriptor.sql.SqlTypeDescriptor的典型用法代码示例。如果您正苦于以下问题:Java SqlTypeDescriptor类的具体用法?Java SqlTypeDescriptor怎么用?Java SqlTypeDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SqlTypeDescriptor类属于org.hibernate.type.descriptor.sql包,在下文中一共展示了SqlTypeDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(final int sqlCode) {
	switch ( sqlCode ) {
	case Types.BOOLEAN:
		return BitTypeDescriptor.INSTANCE;
	case Types.CLOB:
		return HANA_CLOB_STREAM_BINDING;
	case Types.NCLOB:
		return HANA_NCLOB_STREAM_BINDING;
	case Types.TINYINT:
		// tinyint is unsigned on HANA
		return SmallIntTypeDescriptor.INSTANCE;
	default:
		return super.getSqlTypeDescriptorOverride( sqlCode );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AbstractHANADialect.java

示例2: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	SqlTypeDescriptor descriptor;
	switch ( sqlCode ) {
		case Types.BLOB: {
			// Force BLOB binding.  Otherwise, byte[] fields annotated
			// with @Lob will attempt to use
			// BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING.  Since the
			// dialect uses oid for Blobs, byte arrays cannot be used.
			descriptor = BlobTypeDescriptor.BLOB_BINDING;
			break;
		}
		case Types.CLOB: {
			descriptor = ClobTypeDescriptor.CLOB_BINDING;
			break;
		}
		default: {
			descriptor = super.getSqlTypeDescriptorOverride( sqlCode );
			break;
		}
	}
	return descriptor;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:PostgreSQL81Dialect.java

示例3: getOptions

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
private WrapperOptions getOptions(final SessionImplementor session) {
	return new WrapperOptions() {
		public boolean useStreamForLobBinding() {
			return Environment.useStreamsForBinary()
					|| session.getFactory().getDialect().useInputStreamToInsertBlob();
		}

		public LobCreator getLobCreator() {
			return Hibernate.getLobCreator( session );
		}

		public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
			final SqlTypeDescriptor remapped = sqlTypeDescriptor.canBeRemapped()
					? session.getFactory().getDialect().remapSqlTypeDescriptor( sqlTypeDescriptor )
					: sqlTypeDescriptor;
			return remapped == null ? sqlTypeDescriptor : remapped;
		}
	};
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:AbstractStandardBasicType.java

示例4: getBinder

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) { 

 return new BasicBinder<X>(javaTypeDescriptor, (SqlTypeDescriptor) this) { 
  @Override 
  protected void doBind(PreparedStatement st, X value, int index, 
    WrapperOptions options) throws SQLException { 
   if (cal == null) { 
    st.setDate(index, 
      javaTypeDescriptor.unwrap(value, Date.class, options)); 
   } else { 
    st.setDate(index, 
      javaTypeDescriptor.unwrap(value, Date.class, options), cal);  
   } 
  } 
 }; 
}
 
开发者ID:windup,项目名称:windup-rulesets,代码行数:17,代码来源:DstSafeDateTypeDescriptor.java

示例5: remapSqlTypeDescriptor

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
 
开发者ID:GastonMauroDiaz,项目名称:buenojo,代码行数:8,代码来源:FixedPostgreSQL82Dialect.java

示例6: remapSqlTypeDescriptor

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
	if (Types.CLOB == sqlTypeDescriptor.getSqlType()) {
		return LongVarcharTypeDescriptor.INSTANCE;
	}
	return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
 
开发者ID:codenergic,项目名称:theskeleton,代码行数:8,代码来源:PostgreSQLDialectCustom.java

示例7: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	switch (sqlCode) {
	case Types.BLOB:
		return BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING;
	case Types.CLOB:
		// Some Sybase drivers cannot support getClob.  See HHH-7889
		return ClobTypeDescriptor.STREAM_BINDING_EXTRACTING;
	default:
		return super.getSqlTypeDescriptorOverride( sqlCode );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:SybaseDialect.java

示例8: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
/**
 * Returns the {@link SqlTypeDescriptor} that should be used to handle the given JDBC type code.  Returns
 * {@code null} if there is no override.
 *
 * @param sqlCode A {@link Types} constant indicating the SQL column type
 * @return The {@link SqlTypeDescriptor} to use as an override, or {@code null} if there is no override.
 */
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	SqlTypeDescriptor descriptor;
	switch ( sqlCode ) {
		case Types.CLOB: {
			descriptor = useInputStreamToInsertBlob() ? ClobTypeDescriptor.STREAM_BINDING : null;
			break;
		}
		default: {
			descriptor = null;
			break;
		}
	}
	return descriptor;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:Dialect.java

示例9: AttributeConverterTypeAdapter

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
public AttributeConverterTypeAdapter(
		String name,
		AttributeConverter<? extends T,?> attributeConverter,
		SqlTypeDescriptor sqlTypeDescriptorAdapter,
		Class modelType,
		Class jdbcType,
		JavaTypeDescriptor<T> entityAttributeJavaTypeDescriptor) {
	super( sqlTypeDescriptorAdapter, entityAttributeJavaTypeDescriptor );
	this.name = name;
	this.modelType = modelType;
	this.jdbcType = jdbcType;
	this.attributeConverter = attributeConverter;

	log.debug( "Created AttributeConverterTypeAdapter -> " + name );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:AttributeConverterTypeAdapter.java

示例10: AttributeConverterSqlTypeDescriptorAdapter

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
public AttributeConverterSqlTypeDescriptorAdapter(
		AttributeConverter converter,
		SqlTypeDescriptor delegate,
		JavaTypeDescriptor intermediateJavaTypeDescriptor) {
	this.converter = converter;
	this.delegate = delegate;
	this.intermediateJavaTypeDescriptor = intermediateJavaTypeDescriptor;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:AttributeConverterSqlTypeDescriptorAdapter.java

示例11: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    if (Types.BLOB == sqlCode) {
        return LongVarbinaryTypeDescriptor.INSTANCE;
    }

    return super.getSqlTypeDescriptorOverride(sqlCode);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:9,代码来源:MidPointPostgreSQLDialect.java

示例12: getExtractor

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
public <X> ValueExtractor<X> getExtractor( 
  final JavaTypeDescriptor<X> javaTypeDescriptor) { 
 return new BasicExtractor<X>(javaTypeDescriptor, (SqlTypeDescriptor) this) { 
  @Override 
  protected X doExtract(ResultSet rs, String name, 
    WrapperOptions options) throws SQLException { 
   if (cal == null) { 
    return javaTypeDescriptor.wrap(rs.getDate(name), options); 
   } else { 
    return javaTypeDescriptor.wrap(rs.getDate(name, cal), options);  
   } 
  } 
 }; 
}
 
开发者ID:windup,项目名称:windup-rulesets,代码行数:15,代码来源:DstSafeDateTypeDescriptor.java

示例13: remapSqlTypeDescriptor

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
{
	if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB)
		return BinaryTypeDescriptor.INSTANCE;
	else
		return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:9,代码来源:PostgresDialect.java

示例14: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	return sqlCode == Types.BOOLEAN ? TinyIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SybaseASE15Dialect.java

示例15: getSqlTypeDescriptorOverride

import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; //导入依赖的package包/类
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
	return sqlCode == Types.BOOLEAN ? BitTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:Oracle8iDialect.java


注:本文中的org.hibernate.type.descriptor.sql.SqlTypeDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。