I gone through the api and found in that they can fire queries on the beans.
Not exactly. API Page states:
The MBean Server can be queried for MBeans that meet a particular condition, using its queryNames or queryMBeans method
So, it's not exactly about regular pojos. MBean
or managed bean
is one of the concepts introduced by Java Management Extensions (JMX) technology. As JMX Technology Overview states:
The Java objects that implement resources and their instrumentation are called managed beans, or MBeans. MBeans must follow the design patterns and interfaces defined in the JMX specification (JSR 3). This ensures that all MBeans provide the instrumentation of managed resources in a standardized way.
Basically MBeans are used to extend standard JVM management functionality. So, developers can integrate application-specific options to standard monitoring tools (jconsole) and, thus, simplify and standardize resource administration.
Query is just a utility class that introduce several methods used to build QueryExps. QueryExp objects are used to query MBeansServer.
Can i use them on my hibernate pojo(to avoid some memory eat up)?
Well, they aren't meant to be used that way. So, using them for such a purposes will just introduce confusion.
If you are looking for a way to query your pojos (I don't understand how does it help with memory eat up, though), check out these questions: