|Query2 query to find all the references of a eobject [message #634857]
||Sun, 24 October 2010 17:03
Registered: October 2010
The usecase i am currently working on, is to retrieve all the references of a EObject's name(belonging to a .ecore) in my workspace.
I am using ReferenceQuery of query2, which is expected to return all the references of the eobject i use as my target, as given below in the code.
refQuery = IndexQueryFactory.createEReferenceQuery();
IndexFactory.getInstance().executeQueryCommand(new QueryCmd<EReferenceDescriptor, EReferenceDescriptor, EReferenceQuery<EReferenceDescriptor>>(refQuery));
Here, I am setting the targetObject's name as the name, whose references are what i am trying to find.
But the result of this, is not all the references of the name, but it somehow returns back unrelated results belonging to other ecores which have absolutely no reference to the eobject i used as target.
Is this is the right option to find all the references of a particular eobject, if yes, what is it that i am missing, that its not able to retrieve all the references
or is there any other api available which can do this?
Powered by FUDForum
. Page generated in 0.02316 seconds