7

how can I count objects in Eclipse MAT using OQL syntax? This doesn't work :

SELECT count(a) FROM org.hibernate.engine.EntityEntry a 
WHERE (toString(a.entityName)="my.pojo")

(I want to count the number of hibernate pojos loaded into memory)

There must be a very quick way to do so...Thanks for helping me out !

Mark
  • 28,783
  • 8
  • 63
  • 92
chamaster
  • 135
  • 2
  • 7

1 Answers1

3
SELECT toString(entry.entityName) FROM org.hibernate.engine.EntityEntry entry WHERE (toString(entry.entityName) = "My.Pojo")

In the result, count will show up as Total:X of Y entries. The value you are interested in is Y.

Echilon
  • 10,064
  • 33
  • 131
  • 217
Bhaskara
  • 31
  • 2