cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to create a query (also a computed one) that return objects of different metaclasses?

lpersichetti
Retired

As the subject say I would like to create a query that is returning a collection of objects of different metaclasses (like you can do using the target selection from the query assistant).

4 Replies

lpersichetti
Retired

Thank you Claudio,

 

using the Generic Object as Target Metaclass I was able to achieve the desired result.

 

Lorenzo

Hello,

 

yes it is possible.

In both code and standard queries. Here are many options:

  1. if all the metaclasses are sub-classes of an Abstract one (the same) just use the abstract one as target metaclass.
  2. you can implement a query by the _multiLegAccessProvider, use the query in the Application property page for responsibilities to have more info about it.
  3. Implement a query by code, in this case when you create the resulting collection, do  not forget to initialize it as GenericObject, so then you can put whatever you wnat inside.

If you want to put in a query both objects (like business processes) and system object (like descriptors) then the answer will be: soory, it is not possible.

 

Kind Regards,

Claudio Pucci

lpersichetti
Retired

Thank you.

lrobinet
MEGA
MEGA

It is possible to query on mutliple MetaClasses only with the quick search tool in the top right on the MEGA workspace only.

 

With written ERQL queries, the assistant tool (check boxes, operators and values), and registered queries, only one MetaClass can be searched at a time.

 

You may use the "Cumulative" as opposed to the default "Reinitialize" mode in order to perform multiple queries and cumulate the results.

 

Even registered query implemented with a macro are limited to a single "MetaClass Target".

 

Outside of the query context, MEGA APIs (code) can be used to return a heterogeneous list of objects.