loadedLocations.add(DESCRIPTOR_LOCATION);
Enumeration<URL> standardDescriptors = context.getTempClassLoader().getResources(
DESCRIPTOR_LOCATION);
while (standardDescriptors.hasMoreElements()) {
JpaEntityMap map = loader.getEntityMap(standardDescriptors.nextElement());
merger.mergeOverride(map);
}
// 2. load from orm.xml within the jars
// TODO: andrus, 4/20/2006 - load from the jar files
// 3. load from explicitly specified descriptors
for (String descriptor : unit.getMappingFileNames()) {
// avoid loading duplicates, such as META-INF/orm.xml that is also explicitly
// mentioned in the unit...
if (loadedLocations.add(descriptor)) {
Enumeration<URL> mappedDescriptors = context
.getTempClassLoader()
.getResources(descriptor);
while (mappedDescriptors.hasMoreElements()) {
JpaEntityMap map = loader.getEntityMap(mappedDescriptors
.nextElement());
merger.mergeOverride(map);
}
}
}