1

Getting obj.id with an OQL query in Java VisualVM (1.8.0_45) returns JavaScript object id (a long value) instead of the value of the Java field. In other words JavaScript id field shadows the Java object id field. Java object value can be seen in the Instances browser, but how to retrieve it via VisualVM OQL?

ililit
  • 1,309
  • 1
  • 12
  • 19

1 Answers1

2

Currently there is no way to access Java object id field. This is a bug in OQL.
You can use the following workaround:

obj["wrapped-object"].getValueOfField("id")
Tomas Hurka
  • 6,723
  • 29
  • 38
  • 1
    In case you, like I, want to actually use this value in the where clause, you have to rewrap it. Assume this is a string value: `... where wrapJavaObject(obj["wrapped-object"].getValueOfField("id")).toString().equals("XXXX")` – Tim Spears May 17 '23 at 23:04