if (m_persistenceUnitMetadata != null) {
// Persistence unit metadata level annotations are not defaults
// and therefore should not be set on the descriptor.
// Set the persistence unit defaults (if there are any) on the descriptor.
XMLPersistenceUnitDefaults persistenceUnitDefaults = m_persistenceUnitMetadata.getPersistenceUnitDefaults();
if (persistenceUnitDefaults != null) {
descriptor.setDefaultAccess(persistenceUnitDefaults.getAccess());
descriptor.setDefaultSchema(persistenceUnitDefaults.getSchema());
descriptor.setDefaultCatalog(persistenceUnitDefaults.getCatalog());
descriptor.setDefaultTenantDiscriminatorColumns(persistenceUnitDefaults.getTenantDiscriminatorColumns());
descriptor.setIsCascadePersist(persistenceUnitDefaults.isCascadePersist());
// Set any default access methods if specified.
if (persistenceUnitDefaults.hasAccessMethods()) {
descriptor.setDefaultAccessMethods(persistenceUnitDefaults.getAccessMethods());
}
}
}
}