Why “pm.newQuery(Employee.class)” and not “pm.newQuery(Employee)” in JDO?
https://stackoverflow.com/questions/2542215
OTHER TIPS
Using the ".class" suffix is a convention of the language, so your second example is just semantically invalid. Nothing you can do about it really. It's equivalent to calling the getClass()
method on an instantiation of the class, like:
Query averageSalaryQuery = pm.newQuery(new Employee().getClass())
So it's already a shortcut ;)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow