Specification Photo java property is very important, otherwise it will lead to problems such as injection or queries

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

A closer look at the code, id the get / set methods written so there's no error, I have no more to see, then looking for a long error, blame themselves more than negligence, which later led to the paging query fails, look at this record, property writing as consistent as possible, otherwise it is not being given, you may not check, you will encounter problems such as the failure of the query or injected.

public class Goods {
	
	**private Integer goodsId;**
	private String goodsName;
	private String goodsType;
	private Double goodsPrice;
	private Integer goodsCount;
		
	public Goods() {
	}
	
	public Goods(Integer id, String goodsName, String goodsType, Double goodsPrice, Integer goodsCount) {
		super();
		this.goodsId = id;
		this.goodsName = goodsName;
		this.goodsType = goodsType;
		this.goodsPrice = goodsPrice;
		this.goodsCount = goodsCount;
	}
	
	@Override
	public String toString() {
		return "Goods [id=" + goodsId + ", goodsName=" + goodsName + ", goodsType=" + goodsType + ", goodsPrice="
				+ goodsPrice + ", goodsCount=" + goodsCount + "]";
	}
	
	**public Integer getGoodsId() {
		return goodsId;
	}
	public void setGoodsId(Integer id) {
		this.goodsId = id;
	}**
	public String getGoodsName() {
		return goodsName;
	}
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	public String getGoodsType() {
		return goodsType;
	}
	public void setGoodsType(String goodsType) {
		this.goodsType = goodsType;
	}
	public Double getGoodsPrice() {
		return goodsPrice;
	}
	public void setGoodsPrice(Double goodsPrice) {
		this.goodsPrice = goodsPrice;
	}
	public Integer getGoodsCount() {
		return goodsCount;
	}
	public void setGoodsCount(Integer goodsCount) {
		this.goodsCount = goodsCount;
	}

Guess you like

Origin blog.csdn.net/weixin_40358672/article/details/94425802