persistenceUnitDescriptor.setProvider(persistenceUnit.getProvider());
PersistenceUnitValidationModeType validationMode = persistenceUnit.getValidationMode();
if (validationMode != null) {
persistenceUnitDescriptor.setValidationMode(validationMode.name());
}
PersistenceUnitCachingType sharedCacheMode = persistenceUnit.getSharedCacheMode();
if (sharedCacheMode != null) {
persistenceUnitDescriptor.setSharedCacheMode(sharedCacheMode.name());
}
for (String clazz : persistenceUnit.getClazz()) {
TypeDescriptor typeDescriptor = descriptorResolverFactory.getTypeDescriptorResolver().resolve(clazz);
persistenceUnitDescriptor.getContains().add(typeDescriptor);
}