⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productbiz.java

📁 shoppingCar 购物车
💻 JAVA
字号:
package com.tarena.shoppingcar.biz;import java.util.List;import com.tarena.shoppingcar.dao.ProductDao;import com.tarena.shoppingcar.entity.Product;import com.tarena.shoppingcar.factory.ProductException;import com.tarena.shoppingcar.factory.ProductFactory;public class ProductBiz {	private ProductDao dao = ProductFactory.getDao();	/**	 * 查看所有商品	 */	public List<Product> getProducts() {		List<Product> products = null;		try {			products = dao.findAll(new Product());		} catch (ProductException e) {			e.printStackTrace();		}		return products;	}	/**	 * 根据id查询商品	 */	public Product findById(int id) {		return dao.findById(id);	}	public int getRowCount(){		return dao.findNum();	}	public List<Product> findByPage(int StartRow,int rowPerPage){		return dao.findByPage(StartRow, rowPerPage);	}	/**	 * 删除商品	 */	public void remove(int id) {		try {			dao.remove(id);		} catch (ProductException e) {			e.printStackTrace();		}	}	/**	 * 更新商品	 * @param product	 */	public void modify(Product product){		try {			dao.modify(product);		} catch (ProductException e) {			e.printStackTrace();		}	}	/**	 * 添加商品	 */	public void add(Product product) {		try {			dao.save(product);		} catch (ProductException e) {			e.printStackTrace();		}	}	public List<Product> findByOrderID(int id) {		return dao.findByOrderID(id);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -