我有这个:
ReportQuery query = new ReportQuery(OpenedFilesReport.class,
generateExpressionOpenedFilesReport());
query.addCount();
Object result = getTopLinkTemplate().executeQuery(query, true);
我可以看到,结果是一个Vector,并且有一个ReportQueryResult类型的结果。还有比
更聪明的方法吗?((ReportQueryResult)((Vector)result).get(0)).getResults()//.. do additional class casts/getter calls
query.setShouldReturnSingleValue(true);
Number result = (Number) getTopLinkTemplate()。executeQuery(查询,真的);
下面是EclipseLink JavaDocs的链接:
http://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/queries/ReportQuery.html setShouldReturnSingleValue % 28布尔% 29日
Doug