Hi David, David Mitchell wrote:
I have a question regarding report queries.The reason is stated in the javadoc for PersistenceBroker.getReportQueryIteratorByQuery(Query query):
What is the purpose of having to provide a OJB persistent class reference
when supplying the query code that will be executed? I can see why you need to provide the following String array with
the names of the fields you want, but why do I
need to pass a specific persistent class type when creating the query?
Returns an Iterator that iterates Object[] calling the .next() method. The Elements returned come from a SELECT ... WHERE sqlStatement
*The Class c is only used to provide the associated JDBC Connection*
OJB must know against which datasource a query should be performed. This information is taken from the ClassDescriptor of class c.
Try it out. But IMO it will result in an error as OJB tries to lookup a datasource from the ClassDescriptor of the class parameter.In the java API docs for the ReportQueryByCriteria, the variable is named "targetClass", as if that was the type of object that the query is populating, but it ISNT really, is it? Could I just pass a null in there in lieu of having to pretend that some real OJB object applies to my query?
If the parameter is null a NullPointerException could be a likely result...
cheers,
Thomas
yours,
David Mitchell
+---------------------------------------------------------+ This message may contain confidential and/or privileged information. If you
are not the addressee or authorized to receive this for the addressee, you
must not use, copy, disclose or take any action based on this message or any
information herein. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message.
Thank you for your cooperation.
+---------------------------------------------------------+
---------------------------------------------------------------------
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]
