?? productmanagerimpl.java
字號:
package com.netshop.domain.service.impl;
import java.util.List;
import com.netshop.domain.model.Category;
import com.netshop.domain.model.Item;
import com.netshop.domain.model.Product;
import com.netshop.domain.dao.CategoryDao;
import com.netshop.domain.dao.ProductDao;
import com.netshop.domain.dao.ItemDao;
import com.netshop.domain.dao.DAOFactory;
import com.netshop.domain.service.*;
public class ProductManagerImpl implements ProductManager {
private CategoryDao cateDao = DAOFactory.getInstance().createCategoryDAO();
private ItemDao itemDao = DAOFactory.getInstance().createItemDAO();
private ProductDao proDAO = DAOFactory.getInstance().createProductDAO();
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#getCategory(java.lang.String)
*/
public Category getCategory(String categoryId) {
// TODO Auto-generated method stub
return this.cateDao.getCategory(categoryId);
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#getCategoryList()
*/
public List getCategoryList() {
// TODO Auto-generated method stub
return this.cateDao.getCategoryList();
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#getItem(java.lang.String)
*/
public Item getItem(String itemId) {
// TODO Auto-generated method stub
Item item = this.itemDao.getItem(itemId);
item.setProduct(this.proDAO.getProduct(item.getProductId()));
return item;
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#getItemListByProduct(java.lang.String)
*/
public List getItemListByProduct(String productId) {
// TODO Auto-generated method stub
return this.itemDao.getItemListByProduct(productId);
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#getProduct(java.lang.String)
*/
public Product getProduct(String productId) {
// TODO Auto-generated method stub
return this.proDAO.getProduct(productId);
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#getProductListByCategory(java.lang.String)
*/
public List getProductListByCategory(String categoryId) {
// TODO Auto-generated method stub
return this.proDAO.getProductListByCategory(categoryId);
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#isItemInStock(java.lang.String)
*/
public boolean isItemInStock(String itemId) {
// TODO Auto-generated method stub
return this.itemDao.isItemInStock(itemId);
}
/*
* (non-Javadoc)
*
* @see org.digitstore.service.ProductManager#searchProductList(java.lang.String)
*/
public List searchProductList(String keywords) {
// TODO Auto-generated method stub
return this.proDAO.searchProductList(keywords);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -