KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > scenario > tools > databases > TPCWDatabase


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Emmanuel Cecchet
22  * Contributor(s): Mathieu Peltier
23  */

24
25 package org.objectweb.cjdbc.scenario.tools.databases;
26
27 import org.objectweb.cjdbc.common.sql.schema.DatabaseColumn;
28 import org.objectweb.cjdbc.common.sql.schema.DatabaseTable;
29
30 /**
31  * Represents the TPCW benchmark database.
32  *
33  * @author <a HREF="mailto:Mathieu.Peltier@inrialpes.fr">Mathieu Peltier</a>
34  */

35 public class TPCWDatabase extends AbstractDatabase
36 {
37   /**
38    * Creates a new <code>TPCWDatabase</code> instance.
39    */

40   public TPCWDatabase()
41   {
42     super();
43     DatabaseTable t;
44
45     t = new DatabaseTable("country", 4);
46     t.addColumn(new DatabaseColumn("co_id", true));
47     t.addColumn(new DatabaseColumn("co_name", false));
48     t.addColumn(new DatabaseColumn("co_exchange", false));
49     t.addColumn(new DatabaseColumn("co_currency", false));
50     schema.addTable(t);
51
52     t = new DatabaseTable("author", 2);
53     t.addColumn(new DatabaseColumn("a_id", true));
54     t.addColumn(new DatabaseColumn("a_fname", false));
55     t.addColumn(new DatabaseColumn("a_lname", false));
56     t.addColumn(new DatabaseColumn("a_mname", false));
57     t.addColumn(new DatabaseColumn("a_dob", false));
58     t.addColumn(new DatabaseColumn("a_bio", false));
59     schema.addTable(t);
60
61     t = new DatabaseTable("customer", 17);
62     t.addColumn(new DatabaseColumn("c_id", true));
63     t.addColumn(new DatabaseColumn("c_uname", false));
64     t.addColumn(new DatabaseColumn("c_passwd", false));
65     t.addColumn(new DatabaseColumn("c_fname", false));
66     t.addColumn(new DatabaseColumn("c_lname", false));
67     t.addColumn(new DatabaseColumn("c_addr_id", false));
68     t.addColumn(new DatabaseColumn("c_phone", false));
69     t.addColumn(new DatabaseColumn("c_email", false));
70     t.addColumn(new DatabaseColumn("c_since", false));
71     t.addColumn(new DatabaseColumn("c_last_login", false));
72     t.addColumn(new DatabaseColumn("c_login", false));
73     t.addColumn(new DatabaseColumn("c_expiration", false));
74     t.addColumn(new DatabaseColumn("c_discount", false));
75     t.addColumn(new DatabaseColumn("c_balance", false));
76     t.addColumn(new DatabaseColumn("c_ytd_pmt", false));
77     t.addColumn(new DatabaseColumn("c_birthdate", false));
78     t.addColumn(new DatabaseColumn("c_data", false));
79     schema.addTable(t);
80
81     t = new DatabaseTable("items", 22);
82     t.addColumn(new DatabaseColumn("i_id", true));
83     t.addColumn(new DatabaseColumn("i_title", false));
84     t.addColumn(new DatabaseColumn("i_a_id", false));
85     t.addColumn(new DatabaseColumn("i_pub_date", false));
86     t.addColumn(new DatabaseColumn("i_publisher", false));
87     t.addColumn(new DatabaseColumn("i_subject", false));
88     t.addColumn(new DatabaseColumn("i_desc_blob", false));
89     t.addColumn(new DatabaseColumn("i_related1", false));
90     t.addColumn(new DatabaseColumn("i_related2", false));
91     t.addColumn(new DatabaseColumn("i_related3", false));
92     t.addColumn(new DatabaseColumn("i_related4", false));
93     t.addColumn(new DatabaseColumn("i_related5", false));
94     t.addColumn(new DatabaseColumn("i_thumbnail", false));
95     t.addColumn(new DatabaseColumn("i_image", false));
96     t.addColumn(new DatabaseColumn("i_srp", false));
97     t.addColumn(new DatabaseColumn("i_cost", false));
98     t.addColumn(new DatabaseColumn("i_avail", false));
99     t.addColumn(new DatabaseColumn("i_stock", false));
100     t.addColumn(new DatabaseColumn("i_isbn", false));
101     t.addColumn(new DatabaseColumn("i_page", false));
102     t.addColumn(new DatabaseColumn("i_backing", false));
103     t.addColumn(new DatabaseColumn("i_dimensions", false));
104     schema.addTable(t);
105
106     t = new DatabaseTable("orders", 11);
107     t.addColumn(new DatabaseColumn("o_id", true));
108     t.addColumn(new DatabaseColumn("o_c_id", false));
109     t.addColumn(new DatabaseColumn("o_date", false));
110     t.addColumn(new DatabaseColumn("o_sub_total", false));
111     t.addColumn(new DatabaseColumn("o_tax", false));
112     t.addColumn(new DatabaseColumn("o_total", false));
113     t.addColumn(new DatabaseColumn("o_ship_type", false));
114     t.addColumn(new DatabaseColumn("o_ship_date", false));
115     t.addColumn(new DatabaseColumn("o_bill_addr_id", false));
116     t.addColumn(new DatabaseColumn("o_ship_addr_id", false));
117     t.addColumn(new DatabaseColumn("o_status", false));
118     schema.addTable(t);
119
120     t = new DatabaseTable("order_line", 6);
121     t.addColumn(new DatabaseColumn("ol_id", true));
122     t.addColumn(new DatabaseColumn("ol_o_id", true));
123     t.addColumn(new DatabaseColumn("ol_i_id", false));
124     t.addColumn(new DatabaseColumn("ol_qty", false));
125     t.addColumn(new DatabaseColumn("ol_discount", false));
126     t.addColumn(new DatabaseColumn("ol_comments", false));
127     schema.addTable(t);
128
129     t = new DatabaseTable("cc_xacts", 9);
130     t.addColumn(new DatabaseColumn("cx_o_id", true));
131     t.addColumn(new DatabaseColumn("cx_type", false));
132     t.addColumn(new DatabaseColumn("cx_num", false));
133     t.addColumn(new DatabaseColumn("cx_name", false));
134     t.addColumn(new DatabaseColumn("cx_expiry", false));
135     t.addColumn(new DatabaseColumn("cx_auth_id", false));
136     t.addColumn(new DatabaseColumn("cx_xact_amt", false));
137     t.addColumn(new DatabaseColumn("cx_xact_date", false));
138     t.addColumn(new DatabaseColumn("cx_co_id", false));
139     schema.addTable(t);
140
141     t = new DatabaseTable("address", 7);
142     t.addColumn(new DatabaseColumn("addr_id", true));
143     t.addColumn(new DatabaseColumn("addr_street1", false));
144     t.addColumn(new DatabaseColumn("addr_street2", false));
145     t.addColumn(new DatabaseColumn("addr_city", false));
146     t.addColumn(new DatabaseColumn("addr_state", false));
147     t.addColumn(new DatabaseColumn("addr_zip", false));
148     t.addColumn(new DatabaseColumn("addr_co_id", false));
149     schema.addTable(t);
150
151     t = new DatabaseTable("shopping_cart", 2);
152     t.addColumn(new DatabaseColumn("sc_id", true));
153     t.addColumn(new DatabaseColumn("sc_time", false));
154     schema.addTable(t);
155
156     t = new DatabaseTable("shopping_cart_line", 3);
157     t.addColumn(new DatabaseColumn("scl_sc_id", true));
158     t.addColumn(new DatabaseColumn("scl_i_id", true));
159     t.addColumn(new DatabaseColumn("scl_qty", false));
160     schema.addTable(t);
161   }
162 }
163
Popular Tags