| Summary: | Raw replication does not replicate all types | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Erwin Betschart <erwin> | ||||
| Component: | cdo.core | Assignee: | Eike Stepper <stepper> | ||||
| Status: | CLOSED FIXED | QA Contact: | Eike Stepper <stepper> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | stefan, stepper | ||||
| Version: | 3.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Erwin Betschart
I added code to create all mappings on demand:
public final Map<EClass, IClassMapping> getClassMappings(boolean createOnDemand)
{
if (createOnDemand)
{
synchronized (classMappings)
{
if (!allClassMappingsCreated)
{
createAllClassMappings();
allClassMappingsCreated = true;
}
}
}
return classMappings;
}
private void createAllClassMappings()
{
InternalRepository repository = (InternalRepository)getStore().getRepository();
InternalCDOPackageRegistry packageRegistry = repository.getPackageRegistry(false);
for (InternalCDOPackageInfo packageInfo : packageRegistry.getPackageInfos())
{
if (!packageInfo.isSystemPackage())
{
for (EClassifier eClassifier : packageInfo.getEPackage().getEClassifiers())
{
if (eClassifier instanceof EClass)
{
EClass eClass = (EClass)eClassifier;
getClassMapping(eClass); // Get or create it
}
}
}
}
}
Committed to HEAD Reopening because of raw replication problems. If the emf model contains abstract types the replication fails with a db error message that a certain table does not exists (these are always abstract types). I'll attach a patch which seems to fix this problem... 1) The number of lines that you added/changed is smaller than 250. confirmed 2) You are the only author of these changed lines. confirmed 3) You apply the EPL to these changed lines. confirmed Created attachment 171375 [details]
Fix for abstract type mappings.
build up class mappings only for non-abstract types.
Good catch! Thank you ;-) Committed to HEAD. Available in 3.0 GA: http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/ |