1 package org.apache.ojb.odmg.shared; 2 3 import java.io.Serializable ; 4 import java.util.Vector ; 5 import java.util.List ; 6 7 10 public class ProductGroup implements org.apache.ojb.odmg.TransactionAware, Serializable 11 { 12 13 public int getId() 14 { 15 return groupId; 16 } 17 18 19 public String toString() 20 { 21 return 22 "----\n" + 23 "group Id: " + groupId + "\n" + 24 "name: " + groupName + "\n" + 25 "description: " + description + "\n" + 26 "articles in group: " + allArticlesInGroup; 27 } 28 29 public ProductGroup(int pGroupId, String pGroupName, 30 String pDescription) 31 { 32 groupId = pGroupId; 33 groupName = pGroupName; 34 description = pDescription; 35 } 36 37 public ProductGroup() 38 { 39 } 40 41 42 public String getName() 43 { 44 return groupName; 45 } 46 47 48 private List allArticlesInGroup; 49 50 private String description; 51 52 private int groupId; 53 54 private String groupName; 55 56 public String getDescription() 57 { 58 return description; 59 } 60 61 65 public void setDescription(String description) 66 { 67 this.description = description; 68 } 69 70 77 public void afterAbort() 78 { 79 } 81 82 86 public void afterCommit() 87 { 88 } 90 91 94 public void beforeAbort() 95 { 96 } 98 99 105 public void beforeCommit() throws org.odmg.TransactionAbortedException 106 { 107 } 109 110 111 112 public void setName(String newName) 113 { 114 groupName = newName; 115 } 116 120 public List getAllArticlesInGroup() 121 { 122 return allArticlesInGroup; 123 } 124 125 129 public void setAllArticlesInGroup(Vector allArticlesInGroup) 130 { 131 this.allArticlesInGroup = allArticlesInGroup; 132 } 133 134 public void addArticle(Article article) 135 { 136 if(allArticlesInGroup == null) 137 { 138 allArticlesInGroup = new Vector (); 139 } 140 allArticlesInGroup.add(article); 141 } 142 143 147 public int getGroupId() 148 { 149 return groupId; 150 } 151 152 156 public void setGroupId(int groupId) 157 { 158 this.groupId = groupId; 159 } 160 161 165 public String getGroupName() 166 { 167 return groupName; 168 } 169 170 174 public void setGroupName(String groupName) 175 { 176 this.groupName = groupName; 177 } 178 179 } 180 | Popular Tags |