public class EntityMarkerClassTransformer extends AbstractClassTransformer implements BroadleafClassTransformer
This class transformer will check to see if there is class that should have been loaded by the MergePersistenceUnitManager
(meaning, it has an @Entity, @MappedSuperclass or @Embeddable annotation on it and will be inside of a persistence.xml).
If it it should have, it will add the fully qualified classname of that class to the transformedClassNames list.
This is a validation check to ensure that the class transformers are actually working properly
| Modifier and Type | Field and Description |
|---|---|
protected List<DirectCopyIgnorePattern> |
ignorePatterns |
protected static org.apache.commons.logging.Log |
LOG |
protected HashSet<String> |
transformedEntityClassNames |
protected HashSet<String> |
transformedNonEntityClassNames |
alreadyLoadedClasses, preLoadClassNamePatterns| Constructor and Description |
|---|
EntityMarkerClassTransformer() |
| Modifier and Type | Method and Description |
|---|---|
void |
compileJPAProperties(Properties props,
Object key) |
protected boolean |
containsTypeLevelPersistenceAnnotation(javassist.bytecode.annotation.Annotation[] annotations)
Determines if a given annotation set contains annotations that correspond to ones that someone would expect to appear
in a persistence.xml
|
List<DirectCopyIgnorePattern> |
getIgnorePatterns() |
HashSet<String> |
getTransformedEntityClassNames() |
HashSet<String> |
getTransformedNonEntityClassNames() |
protected boolean |
isIgnored(String convertedClassName) |
void |
setIgnorePatterns(List<DirectCopyIgnorePattern> ignorePatterns) |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
afterPropertiesSet, setPreLoadClassNamePatternsprotected static final org.apache.commons.logging.Log LOG
protected List<DirectCopyIgnorePattern> ignorePatterns
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform in interface javax.persistence.spi.ClassTransformerIllegalClassFormatExceptionprotected boolean containsTypeLevelPersistenceAnnotation(javassist.bytecode.annotation.Annotation[] annotations)
annotations - protected boolean isIgnored(String convertedClassName)
public void compileJPAProperties(Properties props, Object key) throws Exception
compileJPAProperties in interface BroadleafClassTransformerExceptionpublic HashSet<String> getTransformedEntityClassNames()
public HashSet<String> getTransformedNonEntityClassNames()
MergePersistenceUnitManagerpublic List<DirectCopyIgnorePattern> getIgnorePatterns()
public void setIgnorePatterns(List<DirectCopyIgnorePattern> ignorePatterns)
Copyright © 2018. All rights reserved.