// add transformer before DataMapConverter starts loading the classes via app
// class loader
Map<String, JpaClassDescriptor> managedClasses = loader
.getEntityMap()
.getMangedClasses();
ClassFileTransformer enhancer = new Enhancer(new JpaEnhancerVisitorFactory(
managedClasses));
unit.addTransformer(new UnitClassTransformer(managedClasses, loader
.getContext()
.getTempClassLoader(), enhancer));