shopcarsqlmapdao.java

来自「>项目名称:电脑电子商务平台 >1.运行环境JDK1.6+Orac」· Java 代码 · 共 50 行

JAVA
50
字号
package omega.persistence.sqlmapdao;

import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import omega.domain.Product;
import omega.domain.Shopcart;
import omega.persistence.iface.ShopCarDao;

public class ShopCarSqlMapDao implements ShopCarDao {
	private static SqlMapClient sqlMapper=DaoConfig.getsqlMapper();
	
	public List getShopCar(String username) throws Exception{
		return sqlMapper.queryForList("getCarbyName",username);
	}
	public void delCar(int id) throws Exception {
		sqlMapper.delete("deleteCar", id);
		
	}

	public void insertCar(Shopcart shopcar) throws Exception {
		sqlMapper.insert("insertCar", shopcar);
		
	}

	public void updateCar(Shopcart shopcar) throws Exception {
		sqlMapper.update("updateCar", shopcar);
		
	}
	
	public void updateCarByOrderid(Shopcart shopcar) throws Exception {
		sqlMapper.update("updateCarbyOrderid", shopcar);
		
	}
	public void delCarbyusername(String username) throws Exception {
		sqlMapper.delete("deleteCarbyusername", username);
		
	}
	
	 public Shopcart getMaxId() throws Exception {
		return (Shopcart) sqlMapper.queryForObject("getShopMaxId");
	}

	public int getCount() throws Exception {
		return (Integer) sqlMapper.queryForObject("getShopCount");
	}

}

⌨️ 快捷键说明

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