Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCannot delete connection when specified field in the property is filled in with content
https://www.eclipse.org/forums/index.php/mv/msg/62019/195656/#msg_195656
Originally posted by: nhaphuong.web.de
This is a multi-part message in MIME format.
--------------030002020809060109050703
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
I want to develope something like an Entity Relation Model with GMF. My
nodes should represent the tables and the compartment in the nodes the
attributes of the table.
Ok, I have two nodes (table A und table B). Table A references to table
B. It's the concept of primary und foreign key. To decribe this
relationship graphically I draw a connection between the nodes.
In the property view of the relation, the source and target are correctly.
Source is Table A
Target is Table B
Now I also want to reference to the attributes of the table. For better
understanding you can look at the attach.
If the property of FK Reference and PK Reference are filled, I cannot
delete the connection. If these fields are empty I can delete the
connection.
I looked at the error log and the message is an execute error.
I google this error and in the news they say that this error message has
something to do with OCL constraint. But I can't bring my case with the
case in the newsgroup together.
I hope anybody can help me. Thanks.
Regards Phuong
------------------------------------------------
Here the detail log:
org.eclipse.core.commands.ExecutionException: While executing the
operation, an exception occurred
at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:519)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:193)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:168)
at
org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.exe cute(DiagramAction.java:141)
at
org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction.doR un(DiagramAction.java:103)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.run(AbstractActionHandler.java:359)
at
org.eclipse.gmf.runtime.common.ui.action.ActionManager$1.run (ActionManager.java:225)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.gmf.runtime.common.ui.action.ActionManager.run(A ctionManager.java:223)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er.runWithEvent(AbstractActionHandler.java:377)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be
cast to org.eclipse.emf.ecore.EObject
at
org.eclipse.emf.ecore.util.ECrossReferenceAdapter.handleCros sReference(ECrossReferenceAdapter.java:608)
at
org.eclipse.emf.ecore.util.ECrossReferenceAdapter.selfAdapt( ECrossReferenceAdapter.java:447)
at
org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter. selfAdapt(CrossReferenceAdapter.java:92)
at
org.eclipse.emf.ecore.util.ECrossReferenceAdapter.notifyChan ged(ECrossReferenceAdapter.java:425)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:247)
at
org.eclipse.emf.ecore.util.EObjectEList$Unsettable.unset(EOb jectEList.java:59)
at
org.eclipse.erm.schema.impl.RelationImpl.unsetFK_Reference(R elationImpl.java:369)
at org.eclipse.erm.schema.impl.RelationImpl.eUnset(RelationImpl .java:472)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObj ectImpl.java:1143)
at
org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElemen tCommand.tearDownOutgoingReferences(DestroyElementCommand.ja va:191)
at
org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElemen tCommand.doExecuteWithResult(DestroyElementCommand.java:124)
at
org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTr ansactionalCommand.doExecute(AbstractTransactionalCommand.ja va:246)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:137)
at
org.eclipse.gmf.runtime.common.core.command.CompositeCommand .doExecuteWithResult(CompositeCommand.java:403)
at
org.eclipse.gmf.runtime.common.core.command.AbstractCommand. execute(AbstractCommand.java:134)
at
org.eclipse.emf.workspace.CompositeEMFOperation.doExecute(Co mpositeEMFOperation.java:212)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:137)
at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:511)
... 37 more
The strange thing is: exception was caused by calling org.eclipse.erm.schema.impl.RelationImpl.unsetFK_Reference(R elationImpl.java:369).
AFAIKSee from the trace old value of this feature was instance of java.lang.Boolean,
in the same time EMF AFAIU is waiting for EObject instance here (based on
the metainformation of your model..)
-----------------
Alex Shatalin]]>Alexander Shatalin2008-07-03T15:31:01-00:00Re: Cannot delete connection when specified field in the property isfilled in with content
https://www.eclipse.org/forums/index.php/mv/msg/62019/195756/#msg_195756
Originally posted by: nhaphuong.web.de
Hi Alex,
thanks very much, your advice was brilliant :). My model was not
updated. Now everything works fine.
Regards
> Hello Bonkers,
>
>> Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be
>> cast to org.eclipse.emf.ecore.EObject at
>> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.handleCros sReference(ECrossReferenceAdapter.java:608)
>>
>> at
>> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.selfAdapt( ECrossReferenceAdapter.java:447)
>>
> I'm suggesting you yo pout breakpoint somewhere here to see the reason
> of this class cast exception (particular reference in your domain model)...
>
> The strange thing is: exception was caused by calling
> org.eclipse.erm.schema.impl.RelationImpl.unsetFK_Reference(R elationImpl.java:369).
> AFAIKSee from the trace old value of this feature was instance of
> java.lang.Boolean, in the same time EMF AFAIU is waiting for EObject
> instance here (based on the metainformation of your model..)
>
> -----------------
> Alex Shatalin]]>2008-07-04T07:31:51-00:00