orderMngmntWebapp\src\orderMngr\domain\order\Order.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.util.*; import javax.persistence.*;
import ...
 
 
/** * A business order to buy products. */
/*...*/
13 
@Entity
14 
public class Order
15 
{
16 
   @Id
17 
   private int number;
 
19 
   private String customerId;
 
219
   @OneToMany
  1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32
  2. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 68, 75
  3. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 29, 56
  4. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 48
  5. orderMngr.domain.order.OrderRepositoryTest#createOrder: 28
  6. orderMngr.domain.order.OrderRepositoryTest#removeOrder: 60
  7. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 31
22 
   private final List<OrderItem> items = new LinkedList<>();
 
240
   public Order() {}
     
    26 
       public Order(int number, String customerId)
    279
       {
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32
    2. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 68, 75
    3. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 29, 56
    4. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 48
    5. orderMngr.domain.order.OrderRepositoryTest#createOrder: 28
    6. orderMngr.domain.order.OrderRepositoryTest#removeOrder: 60
    7. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 31
    289
          this.number = number;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32
    2. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 68, 75
    3. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 29, 56
    4. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 48
    5. orderMngr.domain.order.OrderRepositoryTest#createOrder: 28
    6. orderMngr.domain.order.OrderRepositoryTest#removeOrder: 60
    7. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 31
    299
          this.customerId = customerId;
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32
    2. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 68, 75
    3. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 29, 56
    4. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 48
    5. orderMngr.domain.order.OrderRepositoryTest#createOrder: 28
    6. orderMngr.domain.order.OrderRepositoryTest#removeOrder: 60
    7. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 31
    309
       }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32
    2. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 68, 75
    3. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 29, 56
    4. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 48
    5. orderMngr.domain.order.OrderRepositoryTest#createOrder: 28
    6. orderMngr.domain.order.OrderRepositoryTest#removeOrder: 60
    7. orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 31
     
    3216
       public int getNumber() { return number; }
    1. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 70, 75, 77
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 34, 43, 56x2, 59
    3. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 50, 52
    4. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32
    336
       public String getCustomerId() { return customerId; }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 36
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 34
    3. orderMngr.domain.order.OrderRepositoryTest#updateOrder: 50, 52
    4. orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
    348
       public List<OrderItem> getItems() { return items; }
    1. orderMngr.domain.order.OrderFactoryTest#createOrder: 32, 37
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 31, 56, 60, 61
    3. orderMngr.domain.order.OrderRepositoryTest#createOrder: 30, 32
     
    36 
       @Override
    37 
       public boolean equals(Object o)
    38 
       {
    2 Path coverage: 1/4 A: 0 B: 0 C: 0 D: 2
    392
          if (this == o) return true;
    1. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 77
    2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 59
      402
            if (o == null || getClass() != o.getClass()) return false;
      1. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 77
      2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 59
      1. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 77
      2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 59
         
        422
              Order order = (Order) o;
        1. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 77
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 59
         
        442
              return number == order.getNumber();
        1. orderMngr.domain.order.OrderFindersTest#findOrderByCustomer: 77
        2. orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 59
        45 
           }
         
        47 
           @Override
        48 
           public int hashCode()
        49 
           {
        500
              return number;
          51 
             }
          52 
          }