You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2006/10/31 18:23:17 UTC
svn commit: r469572 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model:
./ Address.java Customer.java District.java Order.java OrderLine.java
Warehouse.java
Author: djd
Date: Tue Oct 31 09:23:16 2006
New Revision: 469572
URL: http://svn.apache.org/viewvc?view=rev&rev=469572
Log:
DERBY-1994 (partial) Add the base POJO classes for the data objects in order entry test toolkit.
Added:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Address.java (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Customer.java (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/District.java (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Order.java (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/OrderLine.java (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Warehouse.java (with props)
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Address.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Address.java?view=auto&rev=469572
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Address.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Address.java Tue Oct 31 09:23:16 2006
@@ -0,0 +1,71 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.system.oe.model.Address
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.system.oe.model;
+
+/**
+ * Address of a customer, warehouse or district.
+ * <P>
+ * Fields map to definition in TPC-C for the CUSTOMER,
+ * WAREHOUSE and DISTRICT tables.
+ * The Java names of fields do not include the C_,W_ or D_ prefixes
+ * and are in lower case.
+ * <BR>
+ * All fields have Java bean setters and getters.
+ */
+public class Address {
+
+ private String street1;
+ private String street2;
+ private String city;
+ private String state;
+ private String zip;
+
+ public String getCity() {
+ return city;
+ }
+ public void setCity(String city) {
+ this.city = city;
+ }
+ public String getState() {
+ return state;
+ }
+ public void setState(String state) {
+ this.state = state;
+ }
+ public String getStreet1() {
+ return street1;
+ }
+ public void setStreet1(String street1) {
+ this.street1 = street1;
+ }
+ public String getStreet2() {
+ return street2;
+ }
+ public void setStreet2(String street2) {
+ this.street2 = street2;
+ }
+ public String getZip() {
+ return zip;
+ }
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+}
+
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Customer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Customer.java?view=auto&rev=469572
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Customer.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Customer.java Tue Oct 31 09:23:16 2006
@@ -0,0 +1,176 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.system.oe.model.Customer
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.system.oe.model;
+
+import java.sql.Timestamp;
+
+/**
+ * An Order Entry customer.
+ * <P>
+ * Fields map to definition in TPC-C for the CUSTOMER table.
+ * The Java names of fields do not include the C_ prefix
+ * and are in lower case.
+ * <BR>
+ * For clarity these fields are renamed in Java
+ * <UL>
+ * <LI>w_id => warehouse (SQL column C_W_ID)
+ * <LI>d_id => district (SQL column C_D_ID)
+ * </UL>
+ * <BR>
+ * The columns that map to an address are extracted out as
+ * a Address object with the corresponding Java field address.
+ * <BR>
+ * All fields have Java bean setters and getters.
+ * <BR>
+ * Fields that are DECIMAL in the database map to String in Java
+ * (rather than BigDecimal) to allow running on J2ME/CDC/Foundation.
+ * <P>
+ * Primary key maps to {warehouse,district,id}.
+ * <P>
+ * A Customer object may sparsely populated, when returned from a
+ * business transaction it is only guaranteed to contain the information
+ * required to display the result of that transaction.
+ *
+ */
+public class Customer {
+
+ private short warehouse;
+ private short district;
+ private int id;
+
+ private String first;
+ private String middle;
+ private String last;
+ private Address address;
+ private String phone;
+ private Timestamp since;
+ private String credit;
+ private String credit_lim;
+ private String discount;
+ private String balance;
+ private String ytd_payment;
+ private int payment_cnt;
+ private int delivery_cnt;
+ private String data;
+ public Address getAddress() {
+ return address;
+ }
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+ public String getBalance() {
+ return balance;
+ }
+ public void setBalance(String balance) {
+ this.balance = balance;
+ }
+ public String getCredit() {
+ return credit;
+ }
+ public void setCredit(String credit) {
+ this.credit = credit;
+ }
+ public String getCredit_lim() {
+ return credit_lim;
+ }
+ public void setCredit_lim(String credit_lim) {
+ this.credit_lim = credit_lim;
+ }
+ public String getData() {
+ return data;
+ }
+ public void setData(String data) {
+ this.data = data;
+ }
+ public int getDelivery_cnt() {
+ return delivery_cnt;
+ }
+ public void setDelivery_cnt(int delivery_cnt) {
+ this.delivery_cnt = delivery_cnt;
+ }
+ public String getDiscount() {
+ return discount;
+ }
+ public void setDiscount(String discount) {
+ this.discount = discount;
+ }
+ public short getDistrict() {
+ return district;
+ }
+ public void setDistrict(short district) {
+ this.district = district;
+ }
+ public String getFirst() {
+ return first;
+ }
+ public void setFirst(String first) {
+ this.first = first;
+ }
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ public String getLast() {
+ return last;
+ }
+ public void setLast(String last) {
+ this.last = last;
+ }
+ public String getMiddle() {
+ return middle;
+ }
+ public void setMiddle(String middle) {
+ this.middle = middle;
+ }
+ public int getPayment_cnt() {
+ return payment_cnt;
+ }
+ public void setPayment_cnt(int payment_cnt) {
+ this.payment_cnt = payment_cnt;
+ }
+ public String getPhone() {
+ return phone;
+ }
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+ public Timestamp getSince() {
+ return since;
+ }
+ public void setSince(Timestamp since) {
+ this.since = since;
+ }
+ public short getWarehouse() {
+ return warehouse;
+ }
+ public void setWarehouse(short warehouse) {
+ this.warehouse = warehouse;
+ }
+ public String getYtd_payment() {
+ return ytd_payment;
+ }
+ public void setYtd_payment(String ytd_payment) {
+ this.ytd_payment = ytd_payment;
+ }
+
+}
+
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Customer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/District.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/District.java?view=auto&rev=469572
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/District.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/District.java Tue Oct 31 09:23:16 2006
@@ -0,0 +1,60 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.system.oe.model.District
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.system.oe.model;
+
+/**
+ * An Order Entry district.
+ * <P>
+ * Fields map to definition in TPC-C for the DISTRICT table.
+ * The Java names of fields do not include the D_ prefix
+ * and are in lower case.
+ * For clarity this field are renamed in Java
+ * <UL>
+ * <LI>w_id => warehouse (SQL column D_W_ID)
+ * </UL>
+ * <BR>
+ * The columns that map to an address are extracted out as
+ * a Address object with the corresponding Java field address.
+ * <BR>
+ * All fields have Java bean setters and getters.
+ * <BR>
+ * Fields that are DECIMAL in the database map to String in Java
+ * (rather than BigDecimal) to allow running on J2ME/CDC/Foundation.
+ * <P>
+ * Primary key maps to {warehouse, id}.
+ * <P>
+ * Implemented by extending Warehouse as they share the same basic format.
+ *
+ * <P>
+ * A District object may sparsely populated, when returned from a
+ * business transaction it is only guaranteed to contain the information
+ * required to display the result of that transaction.
+ */
+public class District extends Warehouse {
+ private short warehouse;
+
+ public short getWarehouse() {
+ return warehouse;
+ }
+
+ public void setWarehouse(short warehouse) {
+ this.warehouse = warehouse;
+ }
+}
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/District.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Order.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Order.java?view=auto&rev=469572
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Order.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Order.java Tue Oct 31 09:23:16 2006
@@ -0,0 +1,106 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.system.oe.model.Order
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.system.oe.model;
+
+import java.sql.Timestamp;
+/**
+ * An Order Entry order.
+ * <P>
+ * Fields map to definition in TPC-C for the ORDER table.
+ * The Java names of fields do not include the O_ prefix
+ * and are in lower case.
+ * For clarity these fields are renamed in Java
+ * <UL>
+ * <LI>w_id => warehouse (SQL column O_W_ID)
+ * <LI>d_id => district (SQL column O_D_ID)
+ * <LI>c_id => customer (SQL column O_C_ID)
+ * </UL>
+ * <BR>
+ * The columns that map to an address are extracted out as
+ * a Address object with the corresponding Java field address.
+ * <BR>
+ * All fields have Java bean setters and getters.
+ * <P>
+ * Primary key maps to {warehouse,district,id}.
+ *
+ * <P>
+ * An Order object may sparsely populated, when returned from a
+ * business transaction it is only guaranteed to contain the information
+ * required to display the result of that transaction.
+ */
+public class Order {
+ private int id;
+ private short district;
+ private short warehouse;
+ private int customer;
+ private Timestamp entry_d;
+ private Short carrier_id;
+ private int ol_cnt;
+ private boolean all_local;
+
+ public boolean isAll_local() {
+ return all_local;
+ }
+ public void setAll_local(boolean all_local) {
+ this.all_local = all_local;
+ }
+ public Short getCarrier_id() {
+ return carrier_id;
+ }
+ public void setCarrier_id(Short carrier_id) {
+ this.carrier_id = carrier_id;
+ }
+ public int getCustomer() {
+ return customer;
+ }
+ public void setCustomer(int customer) {
+ this.customer = customer;
+ }
+ public short getDistrict() {
+ return district;
+ }
+ public void setDistrict(short district) {
+ this.district = district;
+ }
+ public Timestamp getEntry_d() {
+ return entry_d;
+ }
+ public void setEntry_d(Timestamp entry_d) {
+ this.entry_d = entry_d;
+ }
+ public int getId() {
+ return id;
+ }
+ public void setId(int id) {
+ this.id = id;
+ }
+ public int getOl_cnt() {
+ return ol_cnt;
+ }
+ public void setOl_cnt(int ol_cnt) {
+ this.ol_cnt = ol_cnt;
+ }
+ public short getWarehouse() {
+ return warehouse;
+ }
+ public void setWarehouse(short warehouse) {
+ this.warehouse = warehouse;
+ }
+}
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Order.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/OrderLine.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/OrderLine.java?view=auto&rev=469572
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/OrderLine.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/OrderLine.java Tue Oct 31 09:23:16 2006
@@ -0,0 +1,102 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.system.oe.model.OrderItem
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.system.oe.model;
+
+import java.sql.Timestamp;
+
+/**
+ * An Order Entry order line item.
+ * <P>
+ * Fields map to definition in TPC-C for the ORDERLINE table.
+ * The Java names of fields do not include the OL_ prefix
+ * and are in lower case.
+ * <BR>
+ * All fields have Java bean setters and getters.
+ * <BR>
+ * Fields that are DECIMAL in the database map to String in Java
+ * (rather than BigDecimal) to allow running on J2ME/CDC/Foundation.
+ * <P>
+ * Primary key maps to {Order,id}, it is assumed that an OrderLine object
+ * exists in the context of an Order object, thus the columns
+ * {OL_O_ID, OL_D_ID, OL_W_ID} are not represented in this class.
+ *
+ * <P>
+ * An OrderLine object may sparsely populated, when returned from a
+ * business transaction it is only guaranteed to contain the information
+ * required to display the result of that transaction.
+ */
+public class OrderLine {
+ /**
+ * Line item order number.
+ */
+ private short number;
+ /**
+ * ITEM number.
+ */
+ private int i_id;
+ private short supply_w_id;
+ private Timestamp delivery_d;
+ private short quantity;
+ private String amount;
+ private String dist_info;
+
+ public String getAmount() {
+ return amount;
+ }
+ public void setAmount(String amount) {
+ this.amount = amount;
+ }
+ public Timestamp getDelivery_d() {
+ return delivery_d;
+ }
+ public void setDelivery_d(Timestamp delivery_d) {
+ this.delivery_d = delivery_d;
+ }
+ public String getDist_info() {
+ return dist_info;
+ }
+ public void setDist_info(String dist_info) {
+ this.dist_info = dist_info;
+ }
+ public int getI_id() {
+ return i_id;
+ }
+ public void setI_id(int i_id) {
+ this.i_id = i_id;
+ }
+ public short getNumber() {
+ return number;
+ }
+ public void setNumber(short number) {
+ this.number = number;
+ }
+ public short getQuantity() {
+ return quantity;
+ }
+ public void setQuantity(short quantity) {
+ this.quantity = quantity;
+ }
+ public short getSupply_w_id() {
+ return supply_w_id;
+ }
+ public void setSupply_w_id(short supply_w_id) {
+ this.supply_w_id = supply_w_id;
+ }
+}
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/OrderLine.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Warehouse.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Warehouse.java?view=auto&rev=469572
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Warehouse.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Warehouse.java Tue Oct 31 09:23:16 2006
@@ -0,0 +1,81 @@
+/*
+ *
+ * Derby - Class org.apache.derbyTesting.system.oe.model.Warehouse
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
+ */
+package org.apache.derbyTesting.system.oe.model;
+
+/**
+ * An Order Entry warehouse.
+ * <P>
+ * Fields map to definition in TPC-C for the WAREHOUSE table.
+ * The Java names of fields do not include the W_ prefix
+ * and are in lower case.
+ * <BR>
+ * The columns that map to an address are extracted out as
+ * a Address object with the corresponding Java field address.
+ * <BR>
+ * All fields have Java bean setters and getters.
+ * <BR>
+ * Fields that are DECIMAL in the database map to String in Java
+ * (rather than BigDecimal) to allow running on J2ME/CDC/Foundation.
+ * <P>
+ * Primary key maps to {id}.
+ *
+ * <P>
+ * A Warehouse object may sparsely populated, when returned from a
+ * business transaction it is only guaranteed to contain the information
+ * required to display the result of that transaction.
+ */
+public class Warehouse {
+ private short id;
+ private String name;
+ private Address address;
+ private String tax;
+ private String ytd;
+
+ public Address getAddress() {
+ return address;
+ }
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+ public short getId() {
+ return id;
+ }
+ public void setId(short id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getTax() {
+ return tax;
+ }
+ public void setTax(String tax) {
+ this.tax = tax;
+ }
+ public String getYtd() {
+ return ytd;
+ }
+ public void setYtd(String ytd) {
+ this.ytd = ytd;
+ }
+}
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/model/Warehouse.java
------------------------------------------------------------------------------
svn:eol-style = native