private void mergeProperties(PersistenceUnitInfo puInfo, ApplicationMetadata appMetadata, String persistenceUnit)
    {
        PersistenceUnitMetadata metadata = appMetadata.getPersistenceUnitMetadata(persistenceUnit);

        metadata.setTransactionType(puInfo.getTransactionType());

        metadata.getClasses().addAll(puInfo.getManagedClassNames());

        metadata.setExcludeUnlistedClasses(puInfo.excludeUnlistedClasses());

        metadata.getProperties().putAll(puInfo.getProperties());

        if (puInfo.getPersistenceProviderClassName() == null
                || PROVIDER_IMPLEMENTATION_NAME.equalsIgnoreCase(puInfo.getPersistenceProviderClassName()))
        {
            metadata.setProvider(puInfo.getPersistenceProviderClassName());
        }
        else
        {
            throw new PersistenceUnitConfigurationException("Invalid persistence provider : "
                    + puInfo.getPersistenceProviderClassName() + ", persistence provider must be "
                    + PROVIDER_IMPLEMENTATION_NAME + ".");
        }

        metadata.getPackages().addAll(puInfo.getMappingFileNames());

        for (URL url : puInfo.getJarFileUrls())
        {
            metadata.addJarFile(url.getPath());
        }
    }
private void mergeProperties ( PersistenceUnitInfo puInfo , ApplicationMetadata appMetadata , String persistenceUnit ) { PersistenceUnitMetadata metadata = appMetadata . getPersistenceUnitMetadata ( persistenceUnit ) ; metadata . setTransactionType ( puInfo . getTransactionType ( ) ) ; metadata . getClasses ( ) . addAll ( puInfo . getManagedClassNames ( ) ) ; metadata . setExcludeUnlistedClasses ( puInfo . excludeUnlistedClasses ( ) ) ; metadata . getProperties ( ) . putAll ( puInfo . getProperties ( ) ) ; if ( puInfo . getPersistenceProviderClassName ( ) == null || PROVIDER_IMPLEMENTATION_NAME . equalsIgnoreCase ( puInfo . getPersistenceProviderClassName ( ) ) ) { metadata . setProvider ( puInfo . getPersistenceProviderClassName ( ) ) ; } else { throw new PersistenceUnitConfigurationException ( "Invalid persistence provider : " + puInfo . getPersistenceProviderClassName ( ) + ", persistence provider must be " + PROVIDER_IMPLEMENTATION_NAME + "." ) ; } metadata . getPackages ( ) . addAll ( puInfo . getMappingFileNames ( ) ) ; for ( URL url : puInfo . getJarFileUrls ( ) ) { metadata . addJarFile ( url . getPath ( ) ) ; } }
@param puInfo
@param appMetadata
@param metadatas
@param persistenceUnit