KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > trade > OrderItem


1 /*
2  * Created on 30.09.2004
3  *
4  */

5 package com.nightlabs.ipanema.trade;
6
7 import java.io.Serializable JavaDoc;
8
9 import com.nightlabs.ipanema.store.Product;
10
11 /**
12  * @author Niklas Schiffler <nick@nightlabs.de>
13  * @author marco schulze - marco at nightlabs dot de
14  *
15  * @jdo.persistence-capable
16  * identity-type = "application"
17  * objectid-class = "com.nightlabs.ipanema.trade.id.OrderItemID"
18  * detachable = "true"
19  *
20  * @jdo.inheritance strategy = "new-table"
21 **/

22 public class OrderItem
23     implements Serializable JavaDoc
24 {
25     /**
26      * @jdo.field primary-key="true"
27      * @jdo.column length="100"
28      */

29     private String JavaDoc organisationID;
30
31     /**
32      * @jdo.field primary-key="true"
33      */

34     private long orderID;
35
36     /**
37      * @jdo.field primary-key="true"
38      */

39     private int orderItemID;
40
41     /**
42      * @jdo.field persistence-modifier="persistent"
43      */

44     private Order order;
45
46     /**
47      * @jdo.field persistence-modifier="persistent"
48      */

49     private Offer offer;
50
51     /**
52      * @jdo.field persistence-modifier="persistent"
53      */

54     private Product product;
55     
56     protected OrderItem() { }
57
58     public OrderItem(Order order, int orderItemID)
59     {
60         if (order == null)
61             throw new NullPointerException JavaDoc("order must not be null");
62
63         this.order = order;
64         this.organisationID = order.getOrganisationID();
65         this.orderID = order.getOrderID();
66         this.orderItemID = orderItemID;
67     }
68 }
69
Popular Tags