final MetaDataRepository repos = new MetaDataRepository();
repos.setConfiguration(new OpenJPAConfigurationImpl());
repos.setMetaDataFactory(factory);
final BCClass type = new Project().loadClass(new ByteArrayInputStream(buffer), new URLClassLoader(new URL[0], getParent()));
final PCEnhancer enhancer = new PCEnhancer(repos.getConfiguration(), type, repos, this);
enhancer.setAddDefaultConstructor(true);
enhancer.setEnforcePropertyRestrictions(true);
if (enhancer.run() != PCEnhancer.ENHANCE_NONE) {
final BCClass pcb = enhancer.getPCBytecode();
final byte[] transformed = AsmAdaptor.toByteArray(pcb, pcb.toByteArray());
if (transformed != null) {
buffer = transformed;
}
}