@Cacheable(value = "Product", key = "#prodId") public Product getGroupProduct(Long prodId) { // 团购产品 String strHQL = "select p,g from Product p, GroupProduct g where p.prodId = g.prodId and p.prodId = ? and p.prodType = 'G'"; List<Object[]> list = findByHQL(strHQL, prodId); if (AppUtils.isNotBlank(list)) { Product p = (Product) list.get(0)[0]; GroupProduct g = (GroupProduct) list.get(0)[1]; g.setProduct(p); p.setGroupProduct(g); return p; } return null; }
public void saveProduct(GroupProduct product) { EventHome.publishEvent(new ProductSaveEvent(product.getProduct())); save(product); }
@ProductUpdate public void updateProduct(GroupProduct product) { EventHome.publishEvent(new ProductUpdateEvent(product.getProduct())); update(product); }