Package org.hibernate.lob

Examples of org.hibernate.lob.BlobImpl


   *
   * @param bytes a byte array
   * @return the Blob
   */
  public static Blob createBlob(byte[] bytes) {
    return new SerializableBlob( new BlobImpl( bytes ) );
  }
View Full Code Here


   * @param stream a binary stream
   * @param length the number of bytes in the stream
   * @return the Blob
   */
  public static Blob createBlob(InputStream stream, int length) {
    return new SerializableBlob( new BlobImpl( stream, length ) );
  }
View Full Code Here

   * @param stream a binary stream
   * @return the Blob
   * @throws IOException
   */
  public static Blob createBlob(InputStream stream) throws IOException {
    return new SerializableBlob( new BlobImpl( stream, stream.available() ) );
  }
View Full Code Here

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

      if ( useInputStream ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
  }
View Full Code Here

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

      if ( useInputStream ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
  }
View Full Code Here

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

                ObjectOutputStream out = new ObjectOutputStream(bytes);
                out.writeObject(value);
                out.flush();
               
                if (useHibernateBlob()) {
                  st.setBlob(index, new BlobImpl(bytes.toByteArray()));
                }
                else {
                    st.setBytes(index, bytes.toByteArray());   
                }
               
View Full Code Here

TOP

Related Classes of org.hibernate.lob.BlobImpl

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.