📄 productcategorydaohibernate.java
字号:
package com.longHua.dao.hibernate;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.longHua.dao.ProductCategoryDao;
import com.longHua.domain.ProductCategory;
public class ProductCategoryDaoHibernate extends HibernateDaoSupport implements ProductCategoryDao {
public void addProductCategory(ProductCategory productCategory) {
getHibernateTemplate().save(productCategory);
}
public void deleteProductCategory(int ID) {
getHibernateTemplate().delete(getOneProductCategory(ID));
}
public ProductCategory getOneProductCategory(int ID) {
return (ProductCategory)getHibernateTemplate().get(com.longHua.domain.ProductCategory.class, ID);
}
@SuppressWarnings("unchecked")
public List<ProductCategory> checkThisProductCategory(String catName) {
return getHibernateTemplate().find("from ProductCategory as ProductCategory where ProductCategory.catName='"+catName+"'");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -