KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > store > ProductTransferTracker


1 /*
2  * Created on 20.10.2004
3  */

4 package com.nightlabs.ipanema.store;
5
6 import java.io.Serializable JavaDoc;
7 import java.util.ArrayList JavaDoc;
8 import java.util.List JavaDoc;
9
10 /**
11  * There exists one instance of ProductTransferTracker per Product. It knows
12  * all ProductTransfers where the product has been a part of.
13  *
14  * @author Marco Schulze - marco at nightlabs dot de
15  *
16  * @jdo.persistence-capable
17  * identity-type = "application"
18  * objectid-class = "com.nightlabs.ipanema.store.id.ProductTransferTrackerID"
19  * detachable = "true"
20  *
21  * @jdo.inheritance strategy = "new-table"
22  */

23 public class ProductTransferTracker 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      * @jdo.column length="100"
34      */

35     private String JavaDoc productID;
36
37     /**
38      * @jdo.field persistence-modifier="persistent"
39      */

40     private Product product;
41     
42     /**
43      * List of ProductTransfer.
44      *
45      * @jdo.field
46      * persistence-modifier="persistent"
47      * collection-type="collection"
48      * element-type="ProductTransfer"
49      *
50      * @jdo.join
51      */

52     protected List JavaDoc transfers = new ArrayList JavaDoc();
53
54     protected ProductTransferTracker() { }
55
56     public ProductTransferTracker(Product product)
57     {
58         this.organisationID = product.getOrganisationID();
59         this.productID = product.getProductID();
60         this.product = product;
61     }
62
63     public void addProductTransfer(ProductTransfer productTransfer)
64     {
65         this.transfers.add(productTransfer);
66     }
67 }
68
Popular Tags