Package org.hibernate.lob

Examples of org.hibernate.lob.BlobImpl


      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

   *
   * @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

   
      final boolean useInputStream = session.getFactory().getDialect().useInputStreamToInsertBlob() &&
        (value instanceof BlobImpl);
     
      if ( useInputStream ) {
        BlobImpl blob = (BlobImpl) value;
        st.setBinaryStream( index, blob.getBinaryStream(), (int) blob.length() );
      }
      else {
        st.setBlob(index, (Blob) value);
      }
     
View Full Code Here

   *
   * @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

   
      final boolean useInputStream = session.getFactory().getDialect().useInputStreamToInsertBlob() &&
        (value instanceof BlobImpl);
     
      if ( useInputStream ) {
        BlobImpl blob = (BlobImpl) value;
        st.setBinaryStream( index, blob.getBinaryStream(), (int) blob.length() );
      }
      else {
        st.setBlob(index, (Blob) value);
      }
     
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.