public String getLastModifiedDate(Object sample) { String modifiedDate = null; ExpressionBuilder builder = new ExpressionBuilder(sample.getClass()); ReportQuery report = new ReportQuery(sample.getClass(), builder); report.addMaximum("modifiedDate"); jpa.getSession().executeQuery(report); List l = (List) jpa.getSession().executeQuery(report); if (l != null && l.size() > 0) { ReportQueryResult o = (ReportQueryResult) l.get(0); modifiedDate = (String) o.getByIndex(0); } return modifiedDate; }