for (PersistenceUnitMetadataHolder holder : puList) {
setAnnotationIndexes(holder, deploymentUnit);
for (PersistenceUnitMetadata pu : holder.getPersistenceUnits()) {
pu.setClassLoader(classLoader);
pu.setTempClassLoaderFactory(new TempClassLoaderFactoryImpl(classLoader));
try {
final HashMap properties = new HashMap();
if (!ValidationMode.NONE.equals(pu.getValidationMode())) {
ValidatorFactory validatorFactory = SerializableValidatorFactory.validatorFactory();
properties.put("javax.persistence.validation.factory", validatorFactory);