You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by do...@apache.org on 2001/06/07 01:09:36 UTC

cvs commit: jakarta-turbine/docs/proposals sql.html

dobbs       01/06/06 16:09:36

  Modified:    docs/proposals sql.html
  Log:
  Rearanging sections, and making the sql examples a little more pretty
  
  Revision  Changes    Path
  1.2       +89 -72    jakarta-turbine/docs/proposals/sql.html
  
  Index: sql.html
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/docs/proposals/sql.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sql.html	2001/06/06 22:59:05	1.1
  +++ sql.html	2001/06/06 23:09:36	1.2
  @@ -169,74 +169,57 @@
                                                   <table border="0" cellspacing="0" cellpadding="2" width="100%">
         <tr><td bgcolor="#525D76">
           <font color="#ffffff" face="arial,helvetica,sanserif">
  -          <a name="Classes likely to be effected by this proposal"><strong>Classes likely to be effected by this proposal</strong></a>
  +          <a name="Example SQL statements to be generated"><strong>Example SQL statements to be generated</strong></a>
           </font>
         </td></tr>
         <tr><td><br/></td></tr>
         <tr><td>
           <blockquote>
                                       <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>
  -                            </blockquote>
  -        </p>
  -      </td></tr>
  -      <tr><td><br/></td></tr>
  -    </table>
  -                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
  -      <tr><td bgcolor="#525D76">
  -        <font color="#ffffff" face="arial,helvetica,sanserif">
  -          <a name="Example SQL statements to be generated"><strong>Example SQL statements to be generated</strong></a>
  -        </font>
  -      </td></tr>
  -      <tr><td><br/></td></tr>
  -      <tr><td>
  -        <blockquote>
  -                                    <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 =
       (
  @@ -251,22 +234,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
  @@ -279,23 +265,54 @@
       (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>
  +                            </blockquote>
  +        </p>
  +      </td></tr>
  +      <tr><td><br/></td></tr>
  +    </table>
  +                                                <table border="0" cellspacing="0" cellpadding="2" width="100%">
  +      <tr><td bgcolor="#525D76">
  +        <font color="#ffffff" face="arial,helvetica,sanserif">
  +          <a name="Classes likely to be effected by this proposal"><strong>Classes likely to be effected by this proposal</strong></a>
  +        </font>
  +      </td></tr>
  +      <tr><td><br/></td></tr>
  +      <tr><td>
  +        <blockquote>
  +                                    <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>
                               </blockquote>
           </p>
         </td></tr>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org