1 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 35 public class TPCWDatabase extends AbstractDatabase 36 { 37 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 |