1 4 5 package org.enhydra.shark.partmappersistence.data; 6 7 import java.util.ArrayList ; 8 import java.util.Iterator ; 9 import java.util.List ; 10 11 16 public class HibernateProcessPartMap { 17 18 private String processId; 19 private HibernatePackage pck; 20 private int id; 21 private List processLevelParticipant = new ArrayList (); 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 getProcessId() { 48 return processId; 49 } 50 51 public void setProcessId(String processId) { 52 this.processId = processId; 53 } 54 55 public List getProcessLevelParticipant() { 56 return processLevelParticipant; 57 } 58 59 public void setProcessLevelParticipant(List 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 toString() { 72 StringBuffer retVal = new StringBuffer (); 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 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 |