Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » How to return multiple results for query on ecore model
How to return multiple results for query on ecore model [message #989651] Fri, 07 December 2012 03:16 Go to next message
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
I have an ecore model and want to execute a ocl query on it that returns multiple results. The basic example I am using is
self.eClassifiers

where self is an EPackage.

I have specified EEList as the return type. But when I execute the query, I get the error message A EEList instance is expected as result. The result is: <toString() value of the actual result>

What do I need to specify as a return type or how do I need to modify the query to get all eClassifiers as the query result?

Thanks for help.
Re: How to return multiple results for query on ecore model [message #989677 is a reply to message #989651] Fri, 07 December 2012 04:49 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 588
Registered: July 2009
Senior Member
Hello,

If your MoDisco query is returning a list of elements, you should set it via the Lower Bound and Upper Bound fields of your query declaration (cf. the attached snapshot showing an OCL query example defined for Java models).
In any case, the Return Type should be the actual type of elements returned by the query.

Hugo
  • Attachment: Snapshot.jpg
    (Size: 52.86KB, Downloaded 74 times)


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: How to return multiple results for query on ecore model [message #990169 is a reply to message #989677] Tue, 11 December 2012 04:09 Go to previous message
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
Thanks. That works.
Previous Topic:edit generated java model
Next Topic:How to specifiy query parameters in the Query Executions view?
Goto Forum:
  


Current Time: Sat Apr 19 05:53:33 EDT 2014

Powered by FUDForum. Page generated in 0.01462 seconds