public class MaterializedClobTypeClassTransformer extends Object implements BroadleafClassTransformer
StringClobType. This has been deprecated in favor of
MaterializedClobType. However, this is not a panacea, as this can map to the wrong type for Postgres. However,
this mapping is correct for Oracle.
The main reason to switch to MaterializedClobType is because it avoids the use of rs.getCharacterStream on the clob column.
Opening the character stream causes the Oracle jdbc driver to allocate a very large buffer array, which contributes to
wasteful short-term memory allocation.
Add this class transformer to any implementation by adding it to the blMergedClassTransformers list in app context:
<bean id="myMaterializedClobTypeClassTransfomer" class="org.broadleafcommerce.common.extensibility.jpa.convert.MaterializedClobTypeClassTransformer"/>
<bean id="myClassTransformers" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<ref bean="myMaterializedClobTypeClassTransfomer"/>
</list>
</property>
</bean>
<bean class="org.broadleafcommerce.common.extensibility.context.merge.LateStageMergeBeanPostProcessor">
<property name="collectionRef" value="myClassTransformers" />
<property name="targetRef" value="blMergedClassTransformers" />
</bean>
| Modifier and Type | Field and Description |
|---|---|
protected List<DirectCopyIgnorePattern> |
ignorePatterns |
| Constructor and Description |
|---|
MaterializedClobTypeClassTransformer() |
| Modifier and Type | Method and Description |
|---|---|
void |
compileJPAProperties(Properties properties,
Object o) |
protected boolean |
containsTypeLevelPersistenceAnnotation(javassist.bytecode.annotation.Annotation[] annotations) |
protected boolean |
isIgnored(String convertedClassName) |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
protected List<DirectCopyIgnorePattern> ignorePatterns
public MaterializedClobTypeClassTransformer()
public void compileJPAProperties(Properties properties, Object o) throws Exception
compileJPAProperties in interface BroadleafClassTransformerExceptionpublic byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform in interface javax.persistence.spi.ClassTransformerIllegalClassFormatExceptionprotected boolean isIgnored(String convertedClassName)
protected boolean containsTypeLevelPersistenceAnnotation(javassist.bytecode.annotation.Annotation[] annotations)
Copyright © 2018. All rights reserved.