Accessing an element in an Array and ArrayList [message #682254] |
Fri, 10 June 2011 17:50  |
Eclipse User |
|
|
|
I have over 100k Object[] records.
Say the Object[] is like this. {"Name", "Value"}
I want to figure out the instances of Object[] with a particular value
Something like Select * from Object[] where Object[1] = "Value"
Please suggest a way to achieve it using the Analyzer or OQL.
Thank You
|
|
|
Re: Accessing an element in an Array and ArrayList [message #684232 is a reply to message #682254] |
Wed, 15 June 2011 09:13  |
Eclipse User |
|
|
|
This is a bit complicated, but something like:
SELECT * FROM java.lang.Object[] s WHERE ((s.@length >= 2) and (s.@referenceArray.get(1) != 0) and (toString(${snapshot}.getObject(${snapshot}.mapAddressToId(s.@referenceArray.get(1)))) = "Value"))
should work.
This finds all the Object arrays then selects those where the length is at least 2, and with element at index 1 not null, and where the element at index 1 as an object address is converted to an MAT object ID, then to an MAT IObject, then converted to a string using an MAT name resolver, then tested against "Value".
Bug 287268 can be used to track ideas for improvements.
|
|
|
Powered by
FUDForum. Page generated in 0.04638 seconds