Package org.company.recordshop.domain

Examples of org.company.recordshop.domain.Product


  /**
   * {@inheritDoc}
   */
  public void deleteProduct(ProductWithCustomersDto object) {
    Assert.notNull(object, "argument [object] may not be null");
    Product existing = customerServiceModelDomainService.readProduct(object
        .getId());
    customerServiceModelDomainService.deleteProduct(existing);
  }
View Full Code Here


  /**
   * {@inheritDoc}
   */
  public void deleteProduct(FullProductDto object) {
    Assert.notNull(object, "argument [object] may not be null");
    Product existing = customerServiceModelDomainService.readProduct(object
        .getId());
    customerServiceModelDomainService.deleteProduct(existing);
  }
View Full Code Here

    Assert.notNull(source, "argument [source] may not be null");
    Assert.isNull(source.getId(),
        "Can not translate a dto with existing id to a new domain object. Dto: "
            + source);
    Product target = new Product(source.getProductNumber(), source
        .getPrice(), source.isOrderable()

    );
    return fromDto(source, target, translated);
View Full Code Here

      target.setProduct(null);
    } else { // source.getProduct() != null ) {
      /* Add a new associated object */
      if (source.getProduct().getId() != null) {
        /* Add an existing object */
        Product original = productDao.retrieve(source.getProduct()
            .getId());
        Product updated = fullProductDtoTranslator.fromDto(source
            .getProduct(), original, translated);
        target.setProduct(updated);
      } else {
        /* Add a new object */
        target.setProduct(fullProductDtoTranslator.fromDto(source
 
View Full Code Here

  private OrderLineDao orderLineDao;

  @Test
  public void testAddAndRetrieve() {
      
      Product product = new Product("PRODNR-1234", 99.99f, true);
       
        OrderLine orderLine = new OrderLine(1, "ORDERLINE-1");
        orderLine.setProduct(product);
       
        orderLineDao.add(orderLine);
View Full Code Here

      target.setProduct(null);
    } else { // source.getProduct() != null ) {
      /* Add a new associated object */
      if (source.getProduct().getId() != null) {
        /* Add an existing object */
        Product original = productDao.retrieve(source.getProduct()
            .getId());
        Product updated = fullProductDtoTranslator.fromDto(source
            .getProduct(), original, translated);
        target.setProduct(updated);
      } else {
        /* Add a new object */
        target.setProduct(fullProductDtoTranslator.fromDto(source
 
View Full Code Here

    private ProductDao productDao;

    @Test
    public void testAddAndRetrieve() {

        Product product = new Product("PRODNR-1234", 99.99f, true);

        productDao.add(product);
        flush();
        clear();

        Product saved = productDao.retrieve(product.getId());
        assertEquals("PRODNR-1234", saved.getProductNumber());

    }
View Full Code Here

    Assert.notNull(source, "argument [source] may not be null");
    Assert.isNull(source.getId(),
        "Can not translate a dto with existing id to a new domain object. Dto: "
            + source);
    Product target = new Product(source.getProductNumber(), source
        .getPrice(), source.isOrderable()

    );
    return fromDto(source, target, translated);
View Full Code Here

 
  @Test
  public final void testUpdateOrderLineQauntity() {
   
    Product product = new Product("1234", 1F, true);
    product.setMinimalQuantity(2);
    OrderLine orderline = new OrderLine(1, "Test line");
    orderline.setQuantity(1);
    try {
      orderline.setProduct(product);
      fail("A BusinessRuleException should be thrown");
View Full Code Here

TOP

Related Classes of org.company.recordshop.domain.Product

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.