OQL syntax for counting objects matching criteria
Asked Answered
E

1

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 !

Erase answered 12/5, 2011 at 10:22 Comment(0)
L
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.

Linnell answered 22/7, 2011 at 16:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.