KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > om > AttributeOptionPeer


1 package org.tigris.scarab.om;
2
3 import java.util.List JavaDoc;
4
5 import org.apache.torque.TorqueException;
6 import org.apache.torque.util.Criteria;
7
8 /* ================================================================
9  * Copyright (c) 2000-2002 CollabNet. All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are
13  * met:
14  *
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  *
18  * 2. Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution.
21  *
22  * 3. The end-user documentation included with the redistribution, if
23  * any, must include the following acknowlegement: "This product includes
24  * software developed by Collab.Net <http://www.Collab.Net/>."
25  * Alternately, this acknowlegement may appear in the software itself, if
26  * and wherever such third-party acknowlegements normally appear.
27  *
28  * 4. The hosted project names must not be used to endorse or promote
29  * products derived from this software without prior written
30  * permission. For written permission, please contact info@collab.net.
31  *
32  * 5. Products derived from this software may not use the "Tigris" or
33  * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
34  * prior written permission of Collab.Net.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
38  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
39  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
40  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
42  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
43  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
44  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
46  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47  *
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of Collab.Net.
52  */

53
54 /**
55   * The skeleton for this class was autogenerated by Torque on:
56   *
57   * [Wed Feb 28 16:36:26 PST 2001]
58   *
59   * You should add additional methods to this class to meet the
60   * application requirements. This class will only be generated as
61   * long as it does not already exist in the output directory.
62   */

63 public class AttributeOptionPeer
64     extends org.tigris.scarab.om.BaseAttributeOptionPeer
65 {
66     /**
67      * Returns an ordered attribute_options list
68      * @return
69      */

70     public static List JavaDoc getSortedAttributeOptions() {
71       List JavaDoc attributeOptions = null;
72       try
73       {
74           Criteria crit = new Criteria();
75           crit.addAscendingOrderByColumn(AttributeOptionPeer.ATTRIBUTE_ID);
76           crit.addAscendingOrderByColumn(AttributeOptionPeer.OPTION_ID);
77           attributeOptions = doSelect(crit);
78           attributeOptions.remove(0);
79       }
80       catch (TorqueException e)
81       {
82         // TODO Auto-generated catch block
83
e.printStackTrace();
84       }
85       return attributeOptions;
86     }
87
88 }
89
90
Popular Tags