本文整理汇总了Java中mobi.nordpos.dao.factory.ProductCategoryPersist类的典型用法代码示例。如果您正苦于以下问题:Java ProductCategoryPersist类的具体用法?Java ProductCategoryPersist怎么用?Java ProductCategoryPersist使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProductCategoryPersist类属于mobi.nordpos.dao.factory包,在下文中一共展示了ProductCategoryPersist类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateCategoryListIsAvalaible
import mobi.nordpos.dao.factory.ProductCategoryPersist; //导入依赖的package包/类
@ValidationMethod
public void validateCategoryListIsAvalaible(ValidationErrors errors) {
ProductCategoryPersist pcPersist = new ProductCategoryPersist();
TaxPersist taxPersist = new TaxPersist();
try {
pcPersist.init(getDataBaseConnection());
taxPersist.init(getDataBaseConnection());
List<ProductCategory> categories = pcPersist.readList();
for (int i = 0; i < categories.size(); i++) {
ProductCategory category = categories.get(i);
List<Product> products = pcPersist.readProductList(category);
for (int j = 0; j < products.size(); j++) {
Product product = products.get(j);
product.setTax(taxPersist.read(product.getTaxCategory().getId()));
products.set(j, product);
}
category.setProductList(products);
categories.set(i, category);
}
setCategoryList(categories);
} catch (SQLException ex) {
getContext().getValidationErrors().addGlobalError(
new SimpleError(ex.getMessage()));
}
}
示例2: validateProductCategoryIdIsAvalaible
import mobi.nordpos.dao.factory.ProductCategoryPersist; //导入依赖的package包/类
@ValidationMethod
public void validateProductCategoryIdIsAvalaible(ValidationErrors errors) {
try {
ProductCategoryPersist pcPersist = new ProductCategoryPersist();
pcPersist.init(getDataBaseConnection());
ProductCategory category = pcPersist.read(getProduct().getProductCategory().getId());
if (category != null) {
getProduct().setProductCategory(category);
} else {
errors.add("product.category.id", new SimpleError(
getLocalizationKey("error.CatalogNotInclude")));
}
} catch (SQLException ex) {
getContext().getValidationErrors().addGlobalError(
new SimpleError(ex.getMessage()));
}
}
示例3: CategoryBaseActionBean
import mobi.nordpos.dao.factory.ProductCategoryPersist; //导入依赖的package包/类
public CategoryBaseActionBean() {
pcPersist = new ProductCategoryPersist();
}