db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/xdocs query.xml
Date Tue, 15 Apr 2003 18:45:32 GMT
brj         2003/04/15 11:45:31

  Modified:    xdocs    query.xml
  Log:
  added description for DISTINCT
  
  Revision  Changes    Path
  1.18      +11 -2     db-ojb/xdocs/query.xml
  
  Index: query.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/query.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- query.xml	20 Mar 2003 17:04:18 -0000	1.17
  +++ query.xml	15 Apr 2003 18:45:31 -0000	1.18
  @@ -36,6 +36,7 @@
   <ol>
   <li>the class of the objects to be retrieved</li>
   <li>a list of criteria</li>
  +<li>a DISTINCT flag</li>
   <li>additional ORDER BY and GROUP BY</li>
   </ol>
   </p>
  @@ -47,11 +48,18 @@
   <source><![CDATA[
   Query q = QueryFactory.newQuery(Person.class, crit);
   ]]></source>
  +</p>
  +
  +<p>
  +To create a DISTINCT-Query, simply add <b>true</b> as third parameter.  
  +<source><![CDATA[
  +Query q = QueryFactory.newQuery(Person.class, crit, true);
  +]]></source>
   
   </p>
   
  +<p>
   Each criterion stands for a column in the SQL-WHERE-clause.
  -<br/>
   
   <source><![CDATA[
   Criteria crit = new Criteria();
  @@ -68,7 +76,8 @@
   SELECT ... FROM PERSON WHERE upper(FIRSTNAME) = "TOM" AND LASTNAME = "hanks";
   ]]></source>
   
  -<br/>
  +</p>
  +
   OJB supports <b>functions</b> in field criteria ie. upper(firstname). When
converting a field name to a database column name, the function is added to the generated
sql. OJB does not and can not verify the correctness of the specified function, an illegal
function will produce an SqlException.
   <br/>
   
  
  
  

Mime
View raw message