KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > accounting > CustomerGroup


1 /*
2  * Created on 28.10.2004
3  */

4 package com.nightlabs.ipanema.accounting;
5
6 import java.io.Serializable JavaDoc;
7
8
9 /**
10  * @author Marco Schulze - marco at nightlabs dot de
11  *
12  * @jdo.persistence-capable
13  * identity-type = "application"
14  * objectid-class = "com.nightlabs.ipanema.accounting.id.CustomerGroupID"
15  * detachable = "true"
16  *
17  * @jdo.inheritance strategy = "new-table"
18  */

19 public class CustomerGroup implements Serializable JavaDoc
20 {
21     /**
22      * @jdo.field primary-key="true"
23      * @jdo.column length="100"
24      */

25     private String JavaDoc organisationID;
26
27     /**
28      * @jdo.field primary-key="true"
29      * @jdo.column length="100"
30      */

31     private String JavaDoc customerGroupID;
32     
33     /**
34      * @jdo.field persistence-modifier="none"
35      */

36     private transient String JavaDoc primaryKey = null;
37
38 // /**
39
// * key: String tariffPK<br/>
40
// * value: Tariff tariff
41
// * <br/><br/>
42
// *
43
// * @jdo.field
44
// * persistence-modifier="persistent"
45
// * collection-type="map"
46
// * key-type="java.lang.String"
47
// * value-type="Tariff"
48
// *
49
// * @jdo.join
50
// */
51
// protected Map tariffs = new HashMap();
52

53     protected CustomerGroup() { }
54     public CustomerGroup(String JavaDoc organisationID, String JavaDoc customerGroupID)
55     {
56         this.organisationID = organisationID;
57         this.customerGroupID = customerGroupID;
58     }
59
60     /**
61      * @return Returns the organisationID.
62      */

63     public String JavaDoc getOrganisationID()
64     {
65         return organisationID;
66     }
67     /**
68      * @return Returns the customerGroupID.
69      */

70     public String JavaDoc getCustomerGroupID()
71     {
72         return customerGroupID;
73     }
74
75     public static String JavaDoc getPrimaryKey(String JavaDoc organisationID, String JavaDoc customerGroupID)
76     {
77         return organisationID + '/' + customerGroupID;
78     }
79     public String JavaDoc getPrimaryKey()
80     {
81         if (primaryKey == null)
82             primaryKey = organisationID + '/' + customerGroupID;
83         return primaryKey;
84     }
85 }
86
Popular Tags