Java 类org.hibernate.type.descriptor.sql.SqlTypeDescriptor 实例源码

项目:lams    文件:AbstractHANADialect.java   
@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 );
    }
}
项目:lams    文件:PostgreSQL81Dialect.java   
@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;
}
项目:lams    文件:AbstractStandardBasicType.java   
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;
        }
    };
}
项目:windup-rulesets    文件:DstSafeDateTypeDescriptor.java   
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);  
   } 
  } 
 }; 
}
项目:buenojo    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:theskeleton    文件:PostgreSQLDialectCustom.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (Types.CLOB == sqlTypeDescriptor.getSqlType()) {
        return LongVarcharTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:lams    文件:SybaseDialect.java   
@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 );
    }
}
项目:lams    文件:Dialect.java   
/**
 * 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;
}
项目:lams    文件:AttributeConverterTypeAdapter.java   
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 );
}
项目:lams    文件:AttributeConverterSqlTypeDescriptorAdapter.java   
public AttributeConverterSqlTypeDescriptorAdapter(
        AttributeConverter converter,
        SqlTypeDescriptor delegate,
        JavaTypeDescriptor intermediateJavaTypeDescriptor) {
    this.converter = converter;
    this.delegate = delegate;
    this.intermediateJavaTypeDescriptor = intermediateJavaTypeDescriptor;
}
项目:shoucang    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:klask-io    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:jhipster-ribbon-hystrix    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:jhipster-ribbon-hystrix    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:jhipster-ribbon-hystrix    文件:_FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:jhipster-ribbon-hystrix    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:engerek    文件:MidPointPostgreSQLDialect.java   
@Override
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    if (Types.BLOB == sqlCode) {
        return LongVarbinaryTypeDescriptor.INSTANCE;
    }

    return super.getSqlTypeDescriptorOverride(sqlCode);
}
项目:Thesis-JHipster    文件:_FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:shoucang    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:ehcache3-samples    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:oyd-pia    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:jhipster    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:ServiceCutter    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:expper    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB) {
        return BinaryTypeDescriptor.INSTANCE;
    }
    return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:midpoint    文件:MidPointPostgreSQLDialect.java   
@Override
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    if (Types.BLOB == sqlCode) {
        return LongVarbinaryTypeDescriptor.INSTANCE;
    }

    return super.getSqlTypeDescriptorOverride(sqlCode);
}
项目:windup-rulesets    文件:DstSafeDateTypeDescriptor.java   
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);  
   } 
  } 
 }; 
}
项目:stdlib    文件:PostgresDialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
{
    if (sqlTypeDescriptor.getSqlType() == java.sql.Types.BLOB)
        return BinaryTypeDescriptor.INSTANCE;
    else
        return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:midpoint    文件:MidPointPostgreSQLDialect.java   
@Override
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    if (Types.BLOB == sqlCode) {
        return LongVarbinaryTypeDescriptor.INSTANCE;
    }

    return super.getSqlTypeDescriptorOverride(sqlCode);
}
项目:lams    文件:SybaseASE15Dialect.java   
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    return sqlCode == Types.BOOLEAN ? TinyIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
}
项目:lams    文件:Oracle8iDialect.java   
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    return sqlCode == Types.BOOLEAN ? BitTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
}
项目:lams    文件:DB2Dialect.java   
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    return sqlCode == Types.BOOLEAN ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
}
项目:lams    文件:SQLServerDialect.java   
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
    return sqlCode == Types.TINYINT ?
            SmallIntTypeDescriptor.INSTANCE :
            super.getSqlTypeDescriptorOverride( sqlCode );
}
项目:lams    文件:AbstractSingleColumnStandardBasicType.java   
public AbstractSingleColumnStandardBasicType(SqlTypeDescriptor sqlTypeDescriptor, JavaTypeDescriptor<T> javaTypeDescriptor) {
    super( sqlTypeDescriptor, javaTypeDescriptor );
}
项目:lams    文件:AbstractStandardBasicType.java   
public AbstractStandardBasicType(SqlTypeDescriptor sqlTypeDescriptor, JavaTypeDescriptor<T> javaTypeDescriptor) {
    this.sqlTypeDescriptor = sqlTypeDescriptor;
    this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() };
    this.javaTypeDescriptor = javaTypeDescriptor;
}
项目:lams    文件:AbstractStandardBasicType.java   
public final SqlTypeDescriptor getSqlTypeDescriptor() {
    return sqlTypeDescriptor;
}
项目:lams    文件:AbstractStandardBasicType.java   
public final void setSqlTypeDescriptor( SqlTypeDescriptor sqlTypeDescriptor ) {
    this.sqlTypeDescriptor = sqlTypeDescriptor;
    this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() };
}
项目:lams    文件:AbstractStandardBasicType.java   
protected SqlTypeDescriptor remapSqlTypeDescriptor(WrapperOptions options) {
    return options.remapSqlTypeDescriptor( sqlTypeDescriptor );
}
项目:lams    文件:BooleanType.java   
protected BooleanType(SqlTypeDescriptor sqlTypeDescriptor, BooleanTypeDescriptor javaTypeDescriptor) {
    super( sqlTypeDescriptor, javaTypeDescriptor );
}
项目:p2p-webtv    文件:FixedPostgreSQL82Dialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
  return sqlTypeDescriptor.getSqlType() == BLOB ? BinaryTypeDescriptor.INSTANCE : super.remapSqlTypeDescriptor(sqlTypeDescriptor);
}
项目:org.fastnate    文件:AllowMissingIdentitySupportDialect.java   
@Override
public SqlTypeDescriptor remapSqlTypeDescriptor(final SqlTypeDescriptor sqlTypeDescriptor) {
    return this.wrapped.remapSqlTypeDescriptor(sqlTypeDescriptor);
}