1 24 25 package org.objectweb.cjdbc.scenario.tools.databases; 26 27 import java.sql.Types ; 28 29 import org.objectweb.cjdbc.common.sql.schema.DatabaseColumn; 30 import org.objectweb.cjdbc.common.sql.schema.DatabaseTable; 31 32 37 public class RUBiSDatabase extends AbstractDatabase 38 { 39 42 public RUBiSDatabase() 43 { 44 super(); 45 DatabaseTable t; 46 47 t = new DatabaseTable("selections",2); 48 schema.addTable(t); 49 50 56 t = new DatabaseTable("categories", 2); 57 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 58 t.addColumn(new DatabaseColumn("name", false, Types.VARCHAR)); 59 schema.addTable(t); 60 61 66 t = new DatabaseTable("regions", 2); 67 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 68 t.addColumn(new DatabaseColumn("name", false, Types.VARCHAR)); 69 schema.addTable(t); 70 71 86 t = new DatabaseTable("users", 10); 87 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 88 t.addColumn(new DatabaseColumn("firstname", false, Types.VARCHAR)); 89 t.addColumn(new DatabaseColumn("lastname", false, Types.VARCHAR)); 90 t.addColumn(new DatabaseColumn("nickname", false, Types.VARCHAR)); 91 t.addColumn(new DatabaseColumn("password", false, Types.VARCHAR)); 92 t.addColumn(new DatabaseColumn("email", false, Types.VARCHAR)); 93 t.addColumn(new DatabaseColumn("rating", false, Types.INTEGER)); 94 t.addColumn(new DatabaseColumn("balance", false, Types.FLOAT)); 95 t.addColumn(new DatabaseColumn("creation_date", false, Types.TIMESTAMP)); 96 t.addColumn(new DatabaseColumn("region", false, Types.INTEGER)); 97 schema.addTable(t); 98 99 117 t = new DatabaseTable("items", 12); 118 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 119 t.addColumn(new DatabaseColumn("name", false, Types.VARCHAR)); 120 t.addColumn(new DatabaseColumn("description", false, Types.VARCHAR)); 121 t.addColumn(new DatabaseColumn("initial_price", false, Types.FLOAT)); 122 t.addColumn(new DatabaseColumn("quantity", false, Types.INTEGER)); 123 t.addColumn(new DatabaseColumn("reserve_price", false, Types.FLOAT)); 124 t.addColumn(new DatabaseColumn("buy_now", false, Types.FLOAT)); 125 t.addColumn(new DatabaseColumn("nb_of_bids", false, Types.INTEGER)); 126 t.addColumn(new DatabaseColumn("max_bid", false, Types.FLOAT)); 127 t.addColumn(new DatabaseColumn("start_date", false, Types.TIMESTAMP)); 128 t.addColumn(new DatabaseColumn("end_date", false, Types.TIMESTAMP)); 129 t.addColumn(new DatabaseColumn("seller", false, Types.INTEGER)); 130 t.addColumn(new DatabaseColumn("category", false, Types.INTEGER)); 131 schema.addTable(t); 132 133 151 t = new DatabaseTable("old_items", 12); 152 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 153 t.addColumn(new DatabaseColumn("name", false, Types.VARCHAR)); 154 t.addColumn(new DatabaseColumn("description", false, Types.VARCHAR)); 155 t.addColumn(new DatabaseColumn("initial_price", false, Types.FLOAT)); 156 t.addColumn(new DatabaseColumn("quantity", false, Types.INTEGER)); 157 t.addColumn(new DatabaseColumn("reserve_price", false, Types.FLOAT)); 158 t.addColumn(new DatabaseColumn("buy_now", false, Types.FLOAT)); 159 t.addColumn(new DatabaseColumn("nb_of_bids", false, Types.INTEGER)); 160 t.addColumn(new DatabaseColumn("max_bid", false, Types.FLOAT)); 161 t.addColumn(new DatabaseColumn("start_date", false, Types.TIMESTAMP)); 162 t.addColumn(new DatabaseColumn("end_date", false, Types.TIMESTAMP)); 163 t.addColumn(new DatabaseColumn("seller", false, Types.INTEGER)); 164 t.addColumn(new DatabaseColumn("category", false, Types.INTEGER)); 165 schema.addTable(t); 166 167 179 t = new DatabaseTable("bids", 7); 180 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 181 t.addColumn(new DatabaseColumn("user_id", false, Types.INTEGER)); 182 t.addColumn(new DatabaseColumn("item_id", false, Types.INTEGER)); 183 t.addColumn(new DatabaseColumn("qty", false, Types.INTEGER)); 184 t.addColumn(new DatabaseColumn("bid", false, Types.FLOAT)); 185 t.addColumn(new DatabaseColumn("max_bid", false, Types.FLOAT)); 186 t.addColumn(new DatabaseColumn("date", false, Types.TIMESTAMP)); 187 schema.addTable(t); 188 189 202 t = new DatabaseTable("comments", 7); 203 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 204 t.addColumn(new DatabaseColumn("from_user_id", false, Types.INTEGER)); 205 t.addColumn(new DatabaseColumn("to_user_id", false, Types.INTEGER)); 206 t.addColumn(new DatabaseColumn("item_id", false, Types.INTEGER)); 207 t.addColumn(new DatabaseColumn("rating", false, Types.INTEGER)); 208 t.addColumn(new DatabaseColumn("date", false, Types.TIMESTAMP)); 209 t.addColumn(new DatabaseColumn("comment", false, Types.VARCHAR)); 210 schema.addTable(t); 211 212 222 t = new DatabaseTable("buy_now", 5); 223 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 224 t.addColumn(new DatabaseColumn("buyer_id", false, Types.INTEGER)); 225 t.addColumn(new DatabaseColumn("item_id", false, Types.INTEGER)); 226 t.addColumn(new DatabaseColumn("qty", false, Types.INTEGER)); 227 t.addColumn(new DatabaseColumn("date", false, Types.TIMESTAMP)); 228 schema.addTable(t); 229 230 241 t = new DatabaseTable("ids", 8); 242 t.addColumn(new DatabaseColumn("id", true, Types.INTEGER)); 243 t.addColumn(new DatabaseColumn("category", false, Types.INTEGER)); 244 t.addColumn(new DatabaseColumn("region", false, Types.INTEGER)); 245 t.addColumn(new DatabaseColumn("users", false, Types.INTEGER)); 246 t.addColumn(new DatabaseColumn("item", false, Types.INTEGER)); 247 t.addColumn(new DatabaseColumn("comment", false, Types.INTEGER)); 248 t.addColumn(new DatabaseColumn("bid", false, Types.INTEGER)); 249 t.addColumn(new DatabaseColumn("buyNow", false, Types.INTEGER)); 250 schema.addTable(t); 251 } 252 } 253 | Popular Tags |