orderMngmntWebapp\src\orderMngr\domain\order\OrderItem.java
 
/* * Copyright (c) 2006 Rogério Liesenfeld * This file is subject to the terms of the MIT license (see LICENSE.txt). */
/*...*/
5 
package orderMngr.domain.order;
 
 
import java.math.*; import javax.persistence.*;
import ...
 
10 
@Entity
11 
public class OrderItem
12 
{
13 
   @Id @GeneratedValue
14 
   private int id;
 
16 
   @ManyToOne
17 
   private Order order;
 
19 
   private String productId;
 
21 
   private String productDescription;
 
23 
   private int quantity;
 
25 
   private BigDecimal unitPrice;
 
270
   public OrderItem() {}
     
    29 
       public OrderItem(String productId, String productDescription, int quantity, BigDecimal unitPrice)
    30 
       {
    313
          this(null, productId, productDescription, quantity, unitPrice);
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    323
       }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
     
    34 
       public OrderItem(
    35 
          Order order, String productId, String productDescription, int quantity, BigDecimal unitPrice)
    366
       {
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    376
          this.order = order;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    386
          this.productId = productId;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    396
          this.productDescription = productDescription;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    406
          this.quantity = quantity;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    416
          this.unitPrice = unitPrice;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
    426
       }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 26x2
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 30, 56
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
    4. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
     
    44 
       public int getId()
    45 
       {
    460
          return id;
      47 
         }
       
      49 
         public Order getOrder()
      50 
         {
      510
            return order;
        52 
           }
         
        54 
           public String getProductId()
        55 
           {
        563
              return productId;
        1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 43
        2. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        57 
           }
         
        59 
           public String getProductDescription()
        60 
           {
        613
              return productDescription;
        1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 43
        2. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        62 
           }
         
        64 
           public int getQuantity()
        65 
           {
        665
              return quantity;
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32x2
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 43
        3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        67 
           }
         
        69 
           public BigDecimal getUnitPrice()
        70 
           {
        715
              return unitPrice;
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32x2
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 43
        3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
        72 
           }
         
        74 
           @Override
        75 
           public boolean equals(Object o)
        76 
           {
        3 Path coverage: 2/4 A: 2 B: 0 C: 0 D: 1
        773
              if (this == o) return true;
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 37x2
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 61
        1. orderMngr.domain.order.OrderFactoryTest#createOrder: 37x2
        781
              if (o == null || getClass() != o.getClass()) return false;
        1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 61
        1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 61
           
          801
                OrderItem orderItem = (OrderItem) o;
          1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 61
           
          821
                return productId.equals(orderItem.productId);
          1. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 61
          83 
             }
           
          85 
             @Override
          86 
             public int hashCode()
          87 
             {
          882
                return productId.hashCode();
          1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32x2
          89 
             }
          90 
          }