本文整理匯總了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();
}