public class Product{//实体
//设置属性
private int Pid;
private String name;
private double price;
private int count;
//无参构造
public Product(){}
//有参构造
public Product(int pid, String name, double price, int count) {
super();
Pid = pid;
this.name = name;
this.price = price;
this.count = count;
}
//重写toString方法
@Override
public String toString() {
System.out.println("商品编号" + "\t商品名称" +"\t商品价格" + "\t库存价格");
return Pid +"\t"+name + "\t"+price +"\t"+count;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getPid() {
return Pid;
}
public interface ProductDAO {//接口
//添加商品
boolean addProduct (Product product);
//显示所有商品信息
void showAllProduct ();
//通过ID查找某一件商品信息
Product finfProductById (int id);
//根据id进行入库操作
boolean inPrduct