[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] GMF Copy and Paste using Hibernate Resource

Hi all,
Hope someone can help me.


GMF Paste isn't creating a new semantic object it returns a reference to the original copied one instead.

When I copy an EditPart its associated model element href is copied with it.

<element xmi:type="com.test.model:ModuleContainer" href="hibernate://?dsname=test#//@children.2/@networkElements.0/@profiles.0/@baseDeviceParts.1"/>

Then when I paste the EditPart. The code tries to resolve a newly created EObject but it doesn't exist yet, so the original EObject is returned instead. I end up with multiple editparts referencing the same model element.

<element xmi:type="com.test.model:ModuleContainer" href="hibernate://?dsname=test#//@children.2/@networkElements.0/@profiles.0/@baseDeviceParts.0"/>

<element xmi:type="com.test.model:ModuleContainer" href="hibernate://?dsname=test#//@children.2/@networkElements.0/@profiles.0/@baseDeviceParts.0"/>

The second element href should end with @baseDeviceParts.1 and not @baseDeviceParts.0.

When I create an object using a Creation Tool the method EcoreUtil.create is called but when I copy and paste it is not called at all.

Any suggestions?

Cheers
Rob