Re: Need constant Object[] size from ReportQuery

2006-09-28 Thread Armin Waibel

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




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Need constant Object[] size from ReportQuery

2006-09-28 Thread Mills, Blake S CTR 805 CSPTS/SCE
I forgot to mention that I am running the ReportQuery on a View(Oracle
db), not a normal table.  I don't know what difference that would make
when selecting.  When I have time I will trace the source code and find
out exactly what is happening.

Thanks anyway.

Blake

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 28, 2006 7:32 AM
To: OJB Users List
Subject: Re: Need constant Object[] size from ReportQuery

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/or
g/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
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]