OQL syntax for calculating object matching criteria

How can I count objects in Eclipse Mcl using OQL syntax? This does not work:

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

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

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

+6
source share
1 answer
SELECT toString(entry.entityName) FROM org.hibernate.engine.EntityEntry entry WHERE (toString(entry.entityName) = "My.Pojo") 

As a result, the score will be displayed as Total:X of Y entries. . The meaning you are interested in is Y

+2
source

Source: https://habr.com/ru/post/887914/


All Articles