Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java
index c1124692e3..507fe38884 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate.teneo/src/org/eclipse/emf/cdo/server/hibernate/teneo/TeneoHibernateMappingProvider.java
@@ -125,23 +125,26 @@ public class TeneoHibernateMappingProvider implements IHibernateMappingProvider
// this will check the global package registry and read the epackages from
// there if the epackage is already present there
- protected List<EPackage> resolveSubPackages(EPackage epack)
+ protected List<EPackage> resolveSubPackages(EPackage ePackage)
{
- final List<EPackage> epacks = new ArrayList<EPackage>();
- if (EPackage.Registry.INSTANCE.get(epack.getNsURI()) != null)
- {
- epacks.add((EPackage)EPackage.Registry.INSTANCE.get(epack.getNsURI()));
- }
- else
+ final List<EPackage> result = new ArrayList<EPackage>();
+ resolveSubPackages(ePackage, result);
+ return result;
+ }
+
+ private void resolveSubPackages(EPackage ePackage, List<EPackage> result)
+ {
+ EPackage globalPackage = EPackage.Registry.INSTANCE.getEPackage(ePackage.getNsURI());
+ if (globalPackage != null)
{
- epacks.add(epack);
+ ePackage = globalPackage;
}
- for (EPackage subEPackage : epack.getESubpackages())
+ result.add(ePackage);
+ for (EPackage subEPackage : ePackage.getESubpackages())
{
- epacks.addAll(resolveSubPackages(subEPackage));
+ resolveSubPackages(subEPackage, result);
}
- return epacks;
}
public IHibernateStore getHibernateStore()

Back to the top