Package org.hibernate.engine.jdbc
Class BlobProxy
- java.lang.Object
-
- org.hibernate.engine.jdbc.BlobProxy
-
- All Implemented Interfaces:
InvocationHandler
public class BlobProxy extends Object implements InvocationHandler
Manages aspects of proxyingBlob
references for non-contextual creation, including proxy creation and handling proxy invocations. We use proxies here solely to avoid JDBC version incompatibilities.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Blob
generateProxy(byte[] bytes)
Generates a BlobImpl proxy using byte data.static Blob
generateProxy(InputStream stream, long length)
Generates a BlobImpl proxy using a given number of bytes from an InputStream.Object
invoke(Object proxy, Method method, Object[] args)
-
-
-
Method Detail
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
UnsupportedOperationException
- if any methods other thanBlob.length()
,BlobImplementer.getUnderlyingStream()
,Blob.getBinaryStream()
,Blob.getBytes(long, int)
,Blob.free()
, or toString/equals/hashCode are invoked.Throwable
-
generateProxy
public static Blob generateProxy(byte[] bytes)
Generates a BlobImpl proxy using byte data.- Parameters:
bytes
- The data to be created as a Blob.- Returns:
- The generated proxy.
-
generateProxy
public static Blob generateProxy(InputStream stream, long length)
Generates a BlobImpl proxy using a given number of bytes from an InputStream.- Parameters:
stream
- The input stream of bytes to be created as a Blob.length
- The number of bytes from stream to be written to the Blob.- Returns:
- The generated proxy.
-
-