dobbs       01/06/06 16:05:09

  Modified:    xdocs/proposals sql.xml
  Log:
  Rearanging sections, and making the sql examples a little more pretty
  
  Revision  Changes    Path
  1.2       +78 -60    jakarta-turbine/xdocs/proposals/sql.xml
  
  Index: sql.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/xdocs/proposals/sql.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sql.xml   2001/06/06 22:37:21     1.1
  +++ sql.xml   2001/06/06 23:05:09     1.2
  @@ -26,58 +26,53 @@
     </p>
   </section>
   
  -<section name="Classes likely to be effected by this proposal">
  +<section name="Example SQL statements to be generated">
     <p>
  -    <li>
  -        org.apache.turbine.util.db.Criteria
  -    </li>
  -    <li>
  -        org.apache.turbine.util.db.SqlExpression
  -    </li>
  -    <li>
  -        org.apache.turbine.util.db.adaptor (all classes in the package)
  -    </li>
  -    <li>
  -        org.apache.turbine.om.peer.BasePeer
  -    </li>
  +    Within core pieces of Turbine, we will restrict ourselves to
  +    the statements below that are cross-platform while still
  +    offering users of Turbine an api that can take advantage of
  +    the more advanced options of their specific database.
     </p>
  -</section>
   
  -<section name="Example SQL statements to be generated">
  -  <pre>
  -    1. simple selects
  -    select * from some_table
  -    where some_id = n
  -    
  -    2. multi-table joins
  -    select table1.name,table2.type_name
  +  <ol>
  +    <li>simple selects
  +<pre>    select * from some_table
  +    where some_id = n</pre>
  +    </li>
  +
  +    <li>multi-table joins
  +<pre>    select table1.name,table2.type_name
       from table1,
            table2,
            table3
       where table1.description like '%foo%'
       and table1.one_id=table3.one_id
  -    and table2.two_id=table3.two_id
  -    
  -    3. compound where clauses
  -    select table1.name
  +    and table2.two_id=table3.two_id</pre>
  +    </li>
  +
  +    <li>compound where clauses
  +<pre>    select table1.name
       from table1
       where (table1.age&gt;21 and table1.age&lt;35)
  -    or (table1.age&gt;50 and table1.age&lt;65)
  -    
  -    4. functions
  -    select sum(table1.amount) as sum
  +    or (table1.age&gt;50 and table1.age&lt;65)</pre>
  +    </li>
  +
  +    <li>functions
  +<pre>    select sum(table1.amount) as sum
       from table1
  -    where table1.amount&lt;5000
  -    
  -    5. group by ... having
  -    select type, sum(price)
  +    where table1.amount&lt;5000</pre>
  +    </li>
  +
  +    <li>group by ... having
  +<pre>    select type, sum(price)
       from titles
       where price &lt;= 5
       group by type
  -    having sum(price) &gt; 50
  -    
  -    6. sub-queries
  -    select table1.title)
  +    having sum(price) &gt; 50</pre>
  +    </li>
  +
  +    <li>sub-queries
  +<pre>    select table1.title)
       from table1
       where table1.price =
       (
  @@ -92,22 +87,25 @@
           select pub_id
           from titles
           where type='business'
  -    )
  -    
  -    7. transactions
  -    begin
  +    )</pre>
  +    </li>
  +
  +    <li>transactions
  +<pre>    begin
       &lt;statement1&gt;
       &lt;statement2&gt;
       &lt;statement3&gt;
  -    commit
  -    
  -    8. union, intersect, except (minus)
  -    &lt;statement1&gt;
  +    commit</pre>
  +    </li>
  +
  +    <li>union, intersect, except (minus)
  +<pre>    &lt;statement1&gt;
       union
  -    &lt;statement2&gt;
  -    
  -    9. outer joins
  -    (mysql syntax)
  +    &lt;statement2&gt;</pre>
  +    </li>
  +
  +    <li>outer joins
  +<pre>    (mysql syntax)
       select user.name,preference.name
       from user left join preference
       where user.user_id = preference.user_id
  @@ -120,23 +118,43 @@
       (oracle syntax)
       select user.name,preference.name
       from user, preference
  -    where user.user_id = preference.user_id (+)
  -    
  -    10. stored procedures and functions
  -    execute foo('bar','baz','biz')
  +    where user.user_id = preference.user_id (+)</pre>
  +    </li>
  +
  +    <li>stored procedures and functions
  +<pre>    execute foo('bar','baz','biz')
       
       select table.type, foo(table.column)
       from table
  -    group by table.type
  -    
  -    11. prepared statements
  -    (Any of the above, replacing literal values with ? place-holders.
  +    group by table.type</pre>
  +    </li>
  +
  +    <li>prepared statements
  +<pre>    (Any of the above, replacing literal values with ? place-holders.
       This also calls for some means of passing in the parameters to a
       prepared statement)
       select user.name
       from user
  -    where userid = ?
  -  </pre>
  +    where userid = ?</pre>
  +    </li>
  +  </ol>
  +</section>
  +
  +<section name="Classes likely to be effected by this proposal">
  +  <p>
  +    <li>
  +        org.apache.turbine.util.db.Criteria
  +    </li>
  +    <li>
  +        org.apache.turbine.util.db.SqlExpression
  +    </li>
  +    <li>
  +        org.apache.turbine.util.db.adaptor (all classes in the package)
  +    </li>
  +    <li>
  +        org.apache.turbine.om.peer.BasePeer
  +    </li>
  +  </p>
   </section>
   
   </body>
  
  
  

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

Reply via email to