* processing PersistenceUnitMetadata, there should be only one PersistenceUnitMetadata in all mapping xml files.
*/
private void processPersistenceUnitMetadata(List<JaxbEntityMappings> entityMappingsList) {
for ( JaxbEntityMappings entityMappings : entityMappingsList ) {
//we have to iterate entityMappingsList first to find persistence-unit-metadata
JaxbPersistenceUnitMetadata pum = entityMappings.getPersistenceUnitMetadata();
if ( globalDefaults != null ) {
LOG.duplicateMetadata();
return;
}
if ( pum == null ) {
continue;
}
globalDefaults = new Default();
if ( pum.getXmlMappingMetadataComplete() != null ) {
globalDefaults.setMetadataComplete( true );
indexBuilder.mappingMetadataComplete();
}
JaxbPersistenceUnitDefaults pud = pum.getPersistenceUnitDefaults();
if ( pud == null ) {
return;
}
globalDefaults.setSchema( pud.getSchema() );
globalDefaults.setCatalog( pud.getCatalog() );