KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Created on 29.10.2004
3  */

4 package com.nightlabs.ipanema.trade;
5
6 import java.util.HashMap JavaDoc;
7 import java.util.Map JavaDoc;
8
9 import com.nightlabs.ipanema.transfer.Anchor;
10
11 /**
12  * @author Marco Schulze - marco at nightlabs dot de
13  *
14  * @jdo.persistence-capable
15  * identity-type = "application"
16  * persistence-capable-superclass = "com.nightlabs.ipanema.trade.LegalEntity"
17  * detachable = "true"
18  *
19  * @jdo.inheritance strategy = "new-table"
20  */

21 public class OrganisationLegalEntity extends LegalEntity
22 {
23     public static String JavaDoc getPrimaryKey(String JavaDoc organisationID)
24     {
25         return Anchor.getPrimaryKey(organisationID, OrganisationLegalEntity.class.getName());
26     }
27
28     /**
29      * key: String orderPK<br/>
30      * value: Order order
31      * <br/><br/>
32      *
33      * @jdo.field
34      * persistence-modifier="persistent"
35      * collection-type="map"
36      * key-type="java.lang.String"
37      * value-type="Order"
38      * dependent="true"
39      *
40      * @jdo.join
41      */

42     private Map JavaDoc orders = new HashMap JavaDoc();
43
44 // private String localOrganisationID;
45
// private boolean localOrganisation;
46

47     public OrganisationLegalEntity() { }
48
49     public OrganisationLegalEntity(com.nightlabs.ipanema.organisation.Organisation organisation)
50     {
51         super(organisation.getOrganisationID(), OrganisationLegalEntity.class.getName());
52         this.organisation = organisation;
53 // PersistenceManager pm = JDOHelper.getPersistenceManager(organisation);
54
// if (pm == null)
55
// throw new NullPointerException("organisation has no PersistenceManager attached! Can use this constructor only with a persistent non-detached organisation.");
56
// localOrganisationID = LocalOrganisation.getLocalOrganisation(pm).getOrganisationID();
57
// localOrganisation = localOrganisationID.equals(getOrganisationID());
58
}
59
60     /**
61      * @jdo.field persistence-modifier="persistent"
62      */

63     private com.nightlabs.ipanema.organisation.Organisation organisation;
64
65     /**
66      * @return Returns the organisation.
67      */

68     public com.nightlabs.ipanema.organisation.Organisation getOrganisation()
69     {
70         return organisation;
71     }
72     
73
74 // /**
75
// * @return Returns the localOrganisation.
76
// */
77
// public boolean isLocalOrganisation()
78
// {
79
// return localOrganisation;
80
// }
81
// /**
82
// * @return Returns the localOrganisationID.
83
// */
84
// protected String getLocalOrganisationID()
85
// {
86
// return localOrganisationID;
87
// }
88
}
89
Popular Tags