Package org.sab.invsys.persistence.model.product

Examples of org.sab.invsys.persistence.model.product.ProductGroup


    Product newProduct = mapper.toPersistenceBean(uiBean);
   
    if(uiBean.getProductGroup() != null)
    {
      ProductGroup group = groupRepository.findByGroupName(uiBean.getProductGroup());
      newProduct.setGroup(group);
    }
   
    Product saved = repository.save(newProduct);
    logger.debug("Created Account : " + saved);
View Full Code Here


      return null;
    }
   
    if (! existing.getGroup().getGroupName().equals(uiBean.getProductGroup()))
    {
      ProductGroup group = groupRepository.findByGroupName(uiBean.getProductGroup()) ;
      existing.setGroup(group);
    }

    existing.setDescription(uiBean.getDescription());
    existing.setPrice(uiBean.getPrice());
View Full Code Here

  private ProductGroupMapper mapper = new ProductGroupMapper();

  public ProductGroupUI create(ProductGroupUI uiBean) {

    ProductGroup newGroup = mapper.toPersistenceBean(uiBean);
    ProductGroup saved = repository.save(newGroup);
    logger.debug("Created Product Group : " + saved);

    return mapper.toUIBean(saved);
  }
View Full Code Here

  public ProductGroupUI findByGroupName(String groupName) {
    return mapper.toUIBean(repository.findByGroupName(groupName));
  }

  public ProductGroupUI update(ProductGroupUI uiBean) {
    ProductGroup existing = repository.findByGroupName(uiBean
        .getGroupName());

    if (existing == null) {
      return null;
    }

    existing.setDescription(uiBean.getDescription());

    ProductGroup saved = null;

    try {
      saved = repository.save(existing);
    } catch (Exception e) {
      logger.error(e);
View Full Code Here

    return mapper.toUIBean(saved);
  }

  public Boolean delete(ProductGroupUI uiBean) {
    ProductGroup existing = repository.findByGroupName(uiBean
        .getGroupName());

    if (existing == null) {
      return false;
    }
View Full Code Here

    return ui;
  }

  public ProductGroup toPersistenceBean(ProductGroupUI ui) {
    ProductGroup group = null;

    if (ui != null) {
      group = new ProductGroup();

      group.setCreateadBy(ui.getCreateadBy());
      group.setCreatedDate(ui.getCreatedDate());
      group.setDescription(ui.getDescription());
      group.setId(ui.getId());
      group.setModifiedBy(ui.getModifiedBy());
      group.setModifiedDate(ui.getModifiedDate());
      group.setGroupName(ui.getGroupName());

    }
    return group;
  }
View Full Code Here

      product.setModifiedBy(uiBean.getModifiedBy());
      product.setModifiedDate(uiBean.getModifiedDate());
      product.setPrice(uiBean.getPrice());
      product.setProductName(uiBean.getProductName());

      ProductGroup group = new ProductGroup();
      group.setGroupName(uiBean.getProductGroup());
      product.setGroup(group);

    }
    return product;
  }
View Full Code Here

TOP

Related Classes of org.sab.invsys.persistence.model.product.ProductGroup

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.