Author: arminw Date: Sat Mar 24 15:24:37 2007 New Revision: 522121 URL: http://svn.apache.org/viewvc?view=rev&rev=522121 Log: add doc about new report query feature
Modified: db/ojb/branches/OJB_1_0_RELEASE/src/doc/forrest/src/documentation/content/xdocs/docu/guides/query.xml Modified: db/ojb/branches/OJB_1_0_RELEASE/src/doc/forrest/src/documentation/content/xdocs/docu/guides/query.xml URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/doc/forrest/src/documentation/content/xdocs/docu/guides/query.xml?view=diff&rev=522121&r1=522120&r2=522121 ============================================================================== --- db/ojb/branches/OJB_1_0_RELEASE/src/doc/forrest/src/documentation/content/xdocs/docu/guides/query.xml (original) +++ db/ojb/branches/OJB_1_0_RELEASE/src/doc/forrest/src/documentation/content/xdocs/docu/guides/query.xml Sat Mar 24 15:24:37 2007 @@ -917,6 +917,36 @@ </section> + + <anchor id="arbitrary-sql"/> + <section> + <title>Special case: Report query with arbitrary sql-statements</title> + <p> + Sometimes it can be necessary to perform a query against non-mapped tables + or simply to perform an arbitrary query, e.g. to request a database system + table or a single column table which can't be mapped. + </p> + <p> + This can be done by creating a query by sql and then request a report query + iterator: + </p> + <source><![CDATA[ +String sql = "select * from Article as A1 where A1.name = 'spongebob'"; +Query query = QueryFactory.newQuery(null, sql); +Iterator it = broker.getReportQueryIteratorByQuery(query); +while(it.hasNext()) +{ + Object o = it.next(); + System.out.println("result: " + ArrayUtils.toString(o)); +} + ]]></source> + <note> + OJB use the <code>ResultSetMetaData</code> to determine the correct + SQL type of the <code>ResultSet</code> values, so this feature requires + a proper jdbc-driver implementation. + </note> + </section> + </section> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]