Package org.hibernate.engine.jdbc
Class ClobProxy
java.lang.Object
org.hibernate.engine.jdbc.ClobProxy
- All Implemented Interfaces:
InvocationHandler
- Direct Known Subclasses:
NClobProxy
Manages aspects of proxying
Clobs for non-contextual creation, including proxy creation and
handling proxy invocations. We use proxies here solely to avoid JDBC version incompatibilities.- Author:
- Gavin King, Steve Ebersole, Gail Badner
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClobgenerateProxy(Reader reader, long length) Generates aClobproxy using a character reader of given length.static ClobgenerateProxy(String string) Generates aClobproxy using the string data.protected InputStreamprotected Readerprotected longprotected static ClassLoaderDetermines the appropriate class loader to which the generated proxy should be scoped.protected StringgetSubString(long start, int length) protected CharacterStreamprotected void
-
Constructor Details
-
Method Details
-
getLength
protected long getLength() -
getAsciiStream
- Throws:
SQLException
-
getCharacterStream
- Throws:
SQLException
-
getUnderlyingStream
- Throws:
SQLException
-
getSubString
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
UnsupportedOperationException- if any methods other thanClob.length(),Clob.getAsciiStream(),Clob.getCharacterStream(),ClobImplementer.getUnderlyingStream(),Clob.getSubString(long, int),Clob.free(), or toString/equals/hashCode are invoked.Throwable
-
resetIfNeeded
- Throws:
SQLException
-
generateProxy
Generates aClobproxy using the string data.- Parameters:
string- The data to be wrapped as aClob.- Returns:
- The generated proxy.
-
generateProxy
Generates aClobproxy using a character reader of given length.- Parameters:
reader- The character readerlength- The length of the character reader- Returns:
- The generated proxy.
-
getProxyClassLoader
Determines the appropriate class loader to which the generated proxy should be scoped.- Returns:
- The class loader appropriate for proxy construction.
-