存储订单数据库表

1.我是用powerdesigner设计的,分为两个表,ordername为外键,设置外键时出了点小插曲,这里不罗嗦了,如图:
存储订单数据库表_第1张图片

2.样品单类直接封装这两个表的数据:

public class Order {

    private String from;
    private String to;

    public Order() {
    }

    public Order(String from, String to, String ordertime, String ordername, String presentationdate, String remark,
            int id) {
        super();
        this.from = from;
        this.to = to;
        this.ordertime = ordertime;
        this.ordername = ordername;
        this.presentationdate = presentationdate;
        this.remark = remark;
        this.id = id;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(String ordertime) {
        this.ordertime = ordertime;
    }

    public String getOrdername() {
        return ordername;
    }

    public void setOrdername(String ordername) {
        this.ordername = ordername;
    }

    public String getPresentationdate() {
        return presentationdate;
    }

    public void setPresentationdate(String presentationdate) {
        this.presentationdate = presentationdate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    private String ordertime;
    private String ordername;
    private String presentationdate;
    private String remark;
    private int id;

}
public class Product {

    private String producename;
    private String form;
    private int id;
    private String backstamp;
    private int number;
    private int whitelevel;
    private String packing;

    public Product() {

    }

    public Product(String producename, String form, int id, String backstamp, int number, int whitelevel,
            String packing, String remark, String ordername) {
        super();
        this.producename = producename;
        this.form = form;
        this.id = id;
        this.backstamp = backstamp;
        this.number = number;
        this.whitelevel = whitelevel;
        this.packing = packing;
        this.remark = remark;
        this.ordername = ordername;
    }

    public String getProducename() {
        return producename;
    }

    public void setProducename(String producename) {
        this.producename = producename;
    }

    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBackstamp() {
        return backstamp;
    }

    public void setBackstamp(String backstamp) {
        this.backstamp = backstamp;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public int getWhitelevel() {
        return whitelevel;
    }

    public void setWhitelevel(int whitelevel) {
        this.whitelevel = whitelevel;
    }

    public String getPacking() {
        return packing;
    }

    public void setPacking(String packing) {
        this.packing = packing;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getOrdername() {
        return ordername;
    }

    public void setOrdername(String ordername) {
        this.ordername = ordername;
    }

    private String remark;
    private String ordername;

}

你可能感兴趣的:(Java)