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 Thu, 20 Mar 2003 17:04:18 GMT
brj         2003/03/20 09:04:18

  Modified:    xdocs    query.xml
  Log:
  documented functions
  
  Revision  Changes    Path
  1.17      +8 -4      db-ojb/xdocs/query.xml
  
  Index: query.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/query.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- query.xml	15 Mar 2003 19:06:12 -0000	1.16
  +++ query.xml	20 Mar 2003 17:04:18 -0000	1.17
  @@ -35,7 +35,8 @@
   A query consists mainly of the following parts:
   <ol>
   <li>the class of the objects to be retrieved</li>
  -<li>a list of criteria with ORDER BY and GROUP BY</li>
  +<li>a list of criteria</li>
  +<li>additional ORDER BY and GROUP BY</li>
   </ol>
   </p>
   <p>
  @@ -55,7 +56,7 @@
   <source><![CDATA[
   Criteria crit = new Criteria();
   
  -crit.addEqualTo("firstname", "tom");
  +crit.addEqualTo("upper(firstname)", "TOM");
   crit.addEqualTo("lastname", "hanks");
   Query q = QueryFactory.newQuery(Person.class, crit);
   ]]></source>
  @@ -64,8 +65,11 @@
   This query will generate an SQL statement like this:
   
   <source><![CDATA[
  -SELECT ... FROM PERSON WHERE FIRSTNAME = "tom" AND LASTNAME = "hanks";
  +SELECT ... FROM PERSON WHERE upper(FIRSTNAME) = "TOM" AND LASTNAME = "hanks";
   ]]></source>
  +
  +<br/>
  +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/>
   
   <subsection name="query criteria">
  @@ -343,7 +347,7 @@
   
       q = QueryFactory.newQuery(Container.class, crit1);
       q.addOrderBy("company.value");	    // user alias
  -    
  +
   ]]></source>
   
   <br/>
  
  
  

Mime
View raw message