Package org.hibernate.type.descriptor

Examples of org.hibernate.type.descriptor.BinaryStream


  public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
    return new BasicBinder<X>( javaTypeDescriptor, this ) {
      @Override
      protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
        if ( options.useStreamForLobBinding() ) {
          final BinaryStream binaryStream = javaTypeDescriptor.unwrap( value, BinaryStream.class, options );
          st.setBinaryStream( index, binaryStream.getInputStream(), binaryStream.getLength() );
        }
        else if ( byte[].class.isInstance( value ) ) {
          // performance shortcut for binding BLOB data in byte[] format
          final byte[] bytes = (byte[]) value;
          st.setBytes( index, bytes );
View Full Code Here


  public <X> ValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
    return new BasicBinder<X>( javaTypeDescriptor, this ) {
      @Override
      protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
        if ( options.useStreamForLobBinding() ) {
          final BinaryStream binaryStream = javaTypeDescriptor.unwrap( value, BinaryStream.class, options );
          st.setBinaryStream( index, binaryStream.getInputStream(), binaryStream.getLength() );
        }
        else {
          st.setBlob( index, javaTypeDescriptor.unwrap( value, Blob.class, options ) );
        }
      }
View Full Code Here

TOP

Related Classes of org.hibernate.type.descriptor.BinaryStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.