[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Does ID property have to be unique in the whole Resource?

I have two classes in my Ecore model, A and B, both have id property, third C class has reference to A (non-containment). When I assign the same ids A and B objects, and save them in one XML resource along with C, the operation executed successfully.
Result xml contains something like:


<?xml version="1.0" encoding="UTF-8"?>
<root>
  <a id=1/>
  <b id=1/>
  <c a="#1"/>
</root>

This xml is what I expect. But when loading this xml I get error: "Value is not legal", cased by ClassCastException.

Is any ability to correct this issue? Is it correct that loading with id s only works when all ids are unique(in my example a and b have to be different)? Why couldn't XMLResource deduce correct type of referenced object based on eReference of containing object?

Thanks in advance,
Alexey