// The transformer is capable of altering domain classes to handle a LAZY hint for OneToOne mappings. It will only
// be returned if we we are meant to process these mappings.
if (enableWeaving) {
Collection persistenceClasses = new ArrayList();
MetadataAsmFactory factory = new MetadataAsmFactory(new MetadataLogger(session), classLoaderToUse);
if (shouldBuildProject) {
// If deploying from a sessions-xml it is still desirable to allow the classes to be weaved.
// build a list of entities the persistence unit represented by this EntityManagerSetupImpl will use
for (Iterator iterator = session.getProject().getDescriptors().keySet().iterator(); iterator.hasNext(); ) {
persistenceClasses.add(factory.getMetadataClass(((Class)iterator.next()).getName()));
}
} else {
// build a list of entities the persistence unit represented by this EntityManagerSetupImpl will use
for (String className : session.getProject().getClassNamesForWeaving()) {
persistenceClasses.add(factory.getMetadataClass(className));
}
}
this.weaver = TransformerFactory.createTransformerAndModifyProject(session, persistenceClasses, classLoaderToUse, weaveLazy, weaveChangeTracking, weaveFetchGroups, weaveInternal, weaveRest);
}
}