Package com.lgx8.gateway.service

Examples of com.lgx8.gateway.service.IGatewayService


    getHibernateTemplate().persist(op);
  }

  @Transactional
  public void deleteOrderProduct(long id) {
    OrderProduct op = findOrderProduct(id);
    if(op!=null) {
      op.getOrders().getOrderProducts().remove(op);
      getHibernateTemplate().delete(op);
    }
  }
View Full Code Here


  @Transactional
  public Orders findCartByUserId(User user) {
    String hql = "from Orders o where o.status="+Orders.STATUS_CART+" and o.user.id="+user.getId();
    List<Orders> list = getHibernateTemplate().find(hql);
    if(list==null||list.size()==0) {
      Orders o = new Orders();
      //o.setId(System.currentTimeMillis());
      o.setUser(user);
      o.setStatus(Orders.STATUS_CART);
      o.setShoppingtime(new Date());
      createOrders(o);
      return o;
    } else {
      return list.get(0);
    }
View Full Code Here

    this.productPropertyCategoryDao = productPropertyCategoryDao;
  }

  @Transactional
  public ProductProperty createProductProperty(Long categoryId, String value) {
    ProductProperty property = new ProductProperty();
    property.setEnabled(true);
   
    ProductPropertyCategory category = productPropertyCategoryDao.findProductPropertyCategoryById(categoryId);
   
    property.setCategory(category);
    property.setValue(value);
    getHibernateTemplate().persist(property);
    return property;
  }
View Full Code Here

    getHibernateTemplate().update(property);
    return property;
  }

  public ProductProperty findProductPropertyById(Long id) {
    ProductProperty property = getHibernateTemplate().get(ProductProperty.class, id);
    return property;
  }
View Full Code Here

    return property;
  }

  @Transactional
  public void deleteProductProperty(Long id) {
    ProductProperty property = findProductPropertyById(id);
    property.setEnabled(false);
    getHibernateTemplate().update(property);
  }
View Full Code Here

  @Transactional
  public ProductProperty createProductProperty(Long categoryId, String value) {
    ProductProperty property = new ProductProperty();
    property.setEnabled(true);
   
    ProductPropertyCategory category = productPropertyCategoryDao.findProductPropertyCategoryById(categoryId);
   
    property.setCategory(category);
    property.setValue(value);
    getHibernateTemplate().persist(property);
    return property;
View Full Code Here

public class ProductPropertyCategoryDao extends BaseDao implements IProductPropertyCategoryDao {

  @Transactional
  public ProductPropertyCategory createProductPropertyCategory(String name) {
    ProductPropertyCategory category = new ProductPropertyCategory();
    category.setEnabled(true);
    category.setName(name);
    getHibernateTemplate().persist(category);
    return category;
  }
View Full Code Here

  }

  @Transactional
  public void deleteProductPropertyCategory(Long id)
  {
    ProductPropertyCategory category = findProductPropertyCategoryById(id);
    category.setEnabled(false);
    getHibernateTemplate().update(category);
//    getHibernateTemplate().delete(findProductPropertyCategoryById(id));
  }
View Full Code Here

    List<ProductPropertyCategory> categorys = getHibernateTemplate().find(hql);
    return categorys;
  }

  public ProductPropertyCategory findProductPropertyCategoryById(Long id) {
    ProductPropertyCategory category = getHibernateTemplate().get(ProductPropertyCategory.class, id);
    return category;
  }
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    ApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
    IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
   
    List<Category> categorys = gatewayService.findAllCategory();
    System.out.println(categorys.get(0).getChilds());
   
    /*AreaCategory areaCategory = new AreaCategory();
    areaCategory.setName("共享良品");
    areaCategory.setDescription("共享良品");
View Full Code Here

TOP

Related Classes of com.lgx8.gateway.service.IGatewayService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.