KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > partmappersistence > data > HibernateProcessPartMap


1 /*
2  * Shark Hibernate PartMapPersistence - Copyright Open Wide
3  */

4
5 package org.enhydra.shark.partmappersistence.data;
6
7 import java.util.ArrayList JavaDoc;
8 import java.util.Iterator JavaDoc;
9 import java.util.List JavaDoc;
10
11 /**
12  * Simple POJO class, part of the participant mapping model
13  *
14  * @author Vladislav Pernin
15  */

16 public class HibernateProcessPartMap {
17
18     private String JavaDoc processId;
19     private HibernatePackage pck;
20     private int id;
21     private List JavaDoc processLevelParticipant = new ArrayList JavaDoc();
22
23     public HibernateProcessPartMap() {
24     }
25
26     public int getId() {
27         return id;
28     }
29
30     public void setId(int id) {
31         this.id = id;
32     }
33
34     public HibernatePackage getPck() {
35         return pck;
36     }
37
38     public void setPck(HibernatePackage pck) {
39         this.pck = pck;
40         if (pck !=null){
41             pck.addProcess(this);
42         } else {
43             pck.removeProcess(this);
44         }
45     }
46         
47     public String JavaDoc getProcessId() {
48         return processId;
49     }
50
51     public void setProcessId(String JavaDoc processId) {
52         this.processId = processId;
53     }
54
55     public List JavaDoc getProcessLevelParticipant() {
56         return processLevelParticipant;
57     }
58     
59     public void setProcessLevelParticipant(List JavaDoc processLevelParticipant) {
60         this.processLevelParticipant = processLevelParticipant;
61     }
62     
63     public void addProcessLevelParticipant (HibernateProcessLevelParticipant proLevelPart){
64         if (!processLevelParticipant.contains(proLevelPart))processLevelParticipant.add(proLevelPart);
65     }
66     
67     public void removeProcessLevelParticipant(HibernateProcessLevelParticipant proLevelPart){
68         processLevelParticipant.remove(proLevelPart);
69     }
70     
71     public String JavaDoc toString() {
72         StringBuffer JavaDoc retVal = new StringBuffer JavaDoc();
73         retVal.append("\nprocessId = "+this.processId);
74         retVal.append("\nid="+this.id);
75         retVal.append("\t**************processLevelParticipant************* \n");
76         if (processLevelParticipant.size() != 0) {
77             for (Iterator JavaDoc it = processLevelParticipant.iterator(); it.hasNext();) {
78                 HibernateProcessLevelParticipant proLevelPart = (HibernateProcessLevelParticipant) it.next();
79                 if (proLevelPart != null) {
80                     retVal.append("\tprocessLevelParticipant = " + proLevelPart.getParticipantId() + "\n");
81                 } else {
82                     retVal.append("\tprocessLevelParticipant NULL!\n");
83                 }
84             }
85         } else {
86             retVal.append("\tno processLevelParticipant \n");
87         }
88         retVal.append("\t**************end processLevelParticipant************* \n");
89         retVal.append("\npack="+this.pck.getPackageId());
90         return retVal.toString();
91     }
92
93 }
Popular Tags