大一综合项目:在项目中对照表的结构创建实体类

1.创建项目结构

 2在项目中对照表的结构创建User实体类

package com.cyh.bean;

public class User {
           
 private  Integer	userId;

 private String	userName;

 private String	pwd;

 private String	sex;

 private String	addr;

public Integer getUserId() {
	return userId;
}

public void setUserId(Integer userId) {
	this.userId = userId;
}

public String getUserName() {
	return userName;
}

public void setUserName(String userName) {
	this.userName = userName;
}

public String getPwd() {
	return pwd;
}

public void setPwd(String pwd) {
	this.pwd = pwd;
}

public String getSex() {
	return sex;
}

public void setSex(String sex) {
	this.sex = sex;
}

public String getAddr() {
	return addr;
}

public void setAddr(String addr) {
	this.addr = addr;
}

public User() {
	super();
}

public User(Integer userId, String userName, String pwd, String sex, String addr) {
	super();
	this.userId = userId;
	this.userName = userName;
	this.pwd = pwd;
	this.sex = sex;
	this.addr = addr;
}

@Override
public String toString() {
	return "User [userId=" + userId + ", userName=" + userName + ", pwd=" + pwd + ", sex=" + sex + ", addr=" + addr
			+ "]";
}


 
 
}

 2在项目中对照表的结构创建Goods实体类

package com.cyh.bean;

public class Goods {
	private  Integer	goodsId;

	private String	goodsName;

	private Double	price;

	private Integer	 stock;

	private String	supplier;

	public Goods() {
	}

	public Goods(Integer goodsId, String goodsName, Double price, Integer stock, String supplier) {
		this.goodsId = goodsId;
		this.goodsName = goodsName;
		this.price = price;
		this.stock = stock;
		this.supplier = supplier;
	}

	@Override
	public String toString() {
		return "Goods{" +
				"goodsId=" + goodsId +
				", goodsName='" + goodsName + '\'' +
				", price=" + price +
				", stock=" + stock +
				", supplier='" + supplier + '\'' +
				'}';
	}

	public void setGoodsId(Integer goodsId) {
		this.goodsId = goodsId;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public void setStock(Integer stock) {
		this.stock = stock;
	}

	public void setSupplier(String supplier) {
		this.supplier = supplier;
	}

	public Integer getGoodsId() {
		return goodsId;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public Double getPrice() {
		return price;
	}

	public Integer getStock() {
		return stock;
	}

	public String getSupplier() {
		return supplier;
	}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程豪豪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值