예제 #1
0
 @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;
 }
예제 #2
0
 public void saveProduct(GroupProduct product) {
   EventHome.publishEvent(new ProductSaveEvent(product.getProduct()));
   save(product);
 }
예제 #3
0
 @ProductUpdate
 public void updateProduct(GroupProduct product) {
   EventHome.publishEvent(new ProductUpdateEvent(product.getProduct()));
   update(product);
 }