public class BucketClobStringType extends Object implements net.sf.hibernate.UserType, org.hibernate.usertype.UserType, Serializable
This type supports custom handling for:
This custom UserType contains a workaround for the Oracle Clob memory problem. To recap, the issue is that when dealing with Clobs, the oracle drivers will return strings with 64k char[] regardless of the amount of data they hold. So, to fix this we need to release that char[] as quickly as possible, via new String().
Modifier and Type | Class and Description |
---|---|
protected static class |
BucketClobStringType.LobCreatorSynchronization
Callback for resource cleanup at the end of a transaction.
|
Constructor and Description |
---|
BucketClobStringType() |
Modifier and Type | Method and Description |
---|---|
Object |
assemble(Serializable cached,
Object owner) |
Object |
deepCopy(Object value) |
Serializable |
disassemble(Object value) |
boolean |
equals(Object x,
Object y) |
protected org.springframework.jdbc.support.lob.LobHandler |
getLobHandler()
Retrieve the configured LobHandler.
|
int |
hashCode(Object x) |
boolean |
isMutable() |
protected boolean |
isUseSetClobAsString()
Get the UseSetString property.
|
boolean |
isUsingHSQL()
Returns ture if we are running with the HSQL hibernate dialect.
|
boolean |
isUsingMySQL()
Returns true if we are running with the MySQL hibernate dialect.
|
boolean |
isUsingOracle()
Returns true if we are running with the Oracle hibernate dialect.
|
Object |
nullSafeGet(ResultSet rs,
String[] names,
Object owner) |
Object |
nullSafeGet(ResultSet rs,
String[] names,
org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object owner) |
void |
nullSafeSet(PreparedStatement st,
Object value,
int index) |
void |
nullSafeSet(PreparedStatement st,
Object value,
int index,
org.hibernate.engine.spi.SharedSessionContractImplementor session) |
Object |
replace(Object original,
Object target,
Object owner) |
Class |
returnedClass() |
protected void |
setUseSetClobAsString(boolean b)
Set the UseSetString property.
|
int[] |
sqlTypes() |
public boolean isUsingOracle()
public boolean isUsingHSQL()
public boolean isUsingMySQL()
protected org.springframework.jdbc.support.lob.LobHandler getLobHandler()
public int[] sqlTypes()
sqlTypes
in interface org.hibernate.usertype.UserType
public Class returnedClass()
returnedClass
in interface org.hibernate.usertype.UserType
public boolean equals(Object x, Object y)
equals
in interface org.hibernate.usertype.UserType
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws net.sf.hibernate.HibernateException, SQLException
net.sf.hibernate.HibernateException
SQLException
public void nullSafeSet(PreparedStatement st, Object value, int index) throws net.sf.hibernate.HibernateException, SQLException
net.sf.hibernate.HibernateException
SQLException
public Object nullSafeGet(ResultSet rs, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) throws SQLException
nullSafeGet
in interface org.hibernate.usertype.UserType
SQLException
public void nullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws org.hibernate.HibernateException, SQLException
nullSafeSet
in interface org.hibernate.usertype.UserType
org.hibernate.HibernateException
SQLException
public Object deepCopy(Object value)
deepCopy
in interface org.hibernate.usertype.UserType
public boolean isMutable()
isMutable
in interface org.hibernate.usertype.UserType
protected void setUseSetClobAsString(boolean b)
b
- useSetClobAsString
protected boolean isUseSetClobAsString()
useSetClobAsString
public int hashCode(Object x) throws org.hibernate.HibernateException
hashCode
in interface org.hibernate.usertype.UserType
org.hibernate.HibernateException
public Serializable disassemble(Object value) throws org.hibernate.HibernateException
disassemble
in interface org.hibernate.usertype.UserType
org.hibernate.HibernateException
public Object assemble(Serializable cached, Object owner) throws org.hibernate.HibernateException
assemble
in interface org.hibernate.usertype.UserType
org.hibernate.HibernateException
Copyright © 2003–2020 Atlassian. All rights reserved.