java - How can I get the result of a Count query in TopLink? -
i have this:
reportquery query = new reportquery(openedfilesreport.class, generateexpressionopenedfilesreport()); query.addcount(); object result = gettoplinktemplate().executequery(query, true);
as can see, result vector , has 1 result of type reportqueryresult. there smarter way of getting result then
((reportqueryresult)((vector)result).get(0)).getresults()//.. additional class casts/getter calls
query.setshouldreturnsinglevalue(true);
number result = (number) gettoplinktemplate().executequery(query, true);
here link eclipselink javadocs:
doug
Comments
Post a Comment