Re: Need constant Object[] size from ReportQuery
Armin Waibel <[email protected]>
| Newsgroups | gmane.comp.jakarta.ojb.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Blake,
Mills, Blake S CTR 805 CSPTS/SCE wrote:
> Hello,
>
> I am trying to use a ReportQuery because I only need a limited amount of
> the data from a certain table. Everything works great except the
> Object[] size returned by the ReportQueryRsIterator changes depending on
> if there are any null values.
>
I test this with latest from SVN (OJB_1_0_RELEASE branch) and can't
reproduce your problem.
Test result for QueryTest#testReportQueryNullFields
http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/QueryTest.java?view=markup
Result_1: {<null>,testReportQueryNullFields_1159443495281,2}
Result_2: {Robert,testReportQueryNullFields_1159443495281,1}
Result_2: {<null>,testReportQueryNullFields_1159443495281,2}
As you can see null-fields are included in the result.
regards,
Armin
> For example if want two column values from your ReportQuery and one of
> them is null, then the returned Object[] size will only one, NOT two.
> How do you know which of the two columns is represented in the Object[]?
> I would expect an Object[] with size two with null in the place of the
> column that had no value. Am I missing something? Below is how I
> setup the ReportQuery.
>
> broker.beginTransaction();
> Criteria criteria = new Criteria();
> criteria.addEqualTo("personAccountId", new
> Integer(person.getId()));
>
> ReportQueryByCriteria reportQuery =
> QueryFactory.newReportQuery(TaskView.class, criteria);
>
> String[] columns = new String[] {"warningThreshold",
> "notApplicable", "dueDate", "doneDate"};
> reportQuery.setAttributes(columns);
>
> Iterator iterator =
> broker.getReportQueryIteratorByQuery(reportQuery);
>
>
> Thanks for the help,
>
> Blake
>