categoryserviceimpl.java
来自「hibernate 简单的例子」· Java 代码 · 共 44 行
JAVA
44 行
package org.itfuture.www.service.impl;
import java.util.List;
import org.itfuture.www.dao.CategoryDao;
import org.itfuture.www.dao.impl.CategoryDaoImpl;
import org.itfuture.www.po.Category;
import org.itfuture.www.po.Item;
import org.itfuture.www.po.Product;
import org.itfuture.www.service.CategoryService;
//服务接口的实现类,调用的全是CategoryDao中的方法
public class CategoryServiceImpl implements CategoryService {
public CategoryDao getCategoryDao() {
return new CategoryDaoImpl();
}
public List <Category> getCategory() {
return this.getCategoryDao().getCategory();
}
public List <Item> getItem(String productid) {
return this.getCategoryDao().getItem(productid);
}
public List <Product> getProduct(String catid) {
return this.getCategoryDao().getProduct(catid);
}
public Item getOneItem(String itemid) {
return this.getCategoryDao().getOneItem(itemid);
}
public static void main(String[]arghs){
CategoryServiceImpl c = new CategoryServiceImpl();
List list = c.getItem("1");
System.out.println(list);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?