|
|
|
|
Re: OQL: Need help with query involving object array and sub-select [message #1219721 is a reply to message #1199096] |
Thu, 05 December 2013 15:00 |
Geoff Alexander Messages: 28 Registered: November 2013 |
Junior Member |
|
|
Thanks for the suggested query. I was able to use it to produce a similar query for my needs:
SELECT OBJECTS p FROM INSTANCEOF com.ibm.ArtifactTechnology.common.XMLElement p WHERE ((SELECT c FROM OBJECTS ${p}.children.array.@referenceArray c WHERE ((c != 0) AND (${snapshot}.getObject(${snapshot}.mapAddressToId(c)).parent != p))) != NULL)
However as you point out, this query only shows bad parents. Since in some cases the query results in hundreds of bad parents with each parent having multiple children (in some case hundreds of children), it's quite tedious to find the bad children.
One way to return bad parent / child pairs would be to perform a query on a parent p / child c join in a query such as
SELECT p, c, c.parent FROM INSTANCEOF com.ibm.ArtifactTechnology.common.XMLElement p, OBJECTS ${p}.children.array.@referenceArray c WHERE ((c != 0) AND (${snapshot}.getObject(${snapshot}.mapAddressToId(c)).parent != p))
Adding a join capability to MAT's OQL would not only be useful in this case, but should rather be of wide-spread, general use. OQL in some related tools already offer join, so I should think that it's technically feasible to add it to MAT's OQL. Please let me know what you think and where / how I should open a formal feature request against MAT?
In the meantime, is there a way to export the parent objects along with their descendants from my first query so that I can perform post-processing to find the bad children? My attempts at exporting so far have only exported the parent objects without any descendants.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04400 seconds