1 package edu.rice.rubis.beans; 2 3 import java.rmi.RemoteException ; 4 import java.util.Properties ; 5 import javax.ejb.*; 6 import java.io.Serializable ; 7 8 15 16 public class IDManagerBean implements EntityBean 17 { 18 private EntityContext entityContext; 19 private transient boolean isDirty; 21 22 23 public Integer id; 24 25 public Integer categoryCount; 26 public Integer regionCount; 27 public Integer userCount; 28 public Integer itemCount; 29 public Integer commentCount; 30 public Integer bidCount; 31 public Integer buyNowCount; 32 33 34 41 public Integer getId() throws RemoteException 42 { 43 return id; 44 } 45 46 52 public Integer getNextCategoryID() throws RemoteException 53 { 54 categoryCount = new Integer (categoryCount.intValue()+1); 55 isDirty = true; return categoryCount; 57 } 58 59 65 public Integer getNextRegionID() throws RemoteException 66 { 67 regionCount = new Integer (regionCount.intValue()+1); 68 isDirty = true; return regionCount; 70 } 71 72 78 public Integer getNextUserID() throws RemoteException 79 { 80 userCount = new Integer (userCount.intValue()+1); 81 isDirty = true; return userCount; 83 } 84 85 91 public Integer getNextItemID() throws RemoteException 92 { 93 itemCount = new Integer (itemCount.intValue()+1); 94 isDirty = true; return itemCount; 96 } 97 98 104 public Integer getNextCommentID() throws RemoteException 105 { 106 commentCount = new Integer (commentCount.intValue()+1); 107 isDirty = true; return commentCount; 109 } 110 111 117 public Integer getNextBidID() throws RemoteException 118 { 119 bidCount = new Integer (bidCount.intValue()+1); 120 isDirty = true; return bidCount; 122 } 123 124 130 public Integer getNextBuyNowID() throws RemoteException 131 { 132 buyNowCount = new Integer (buyNowCount.intValue()+1); 133 isDirty = true; return buyNowCount; 135 } 136 137 138 140 148 public IDManagerPK ejbCreate() throws CreateException, RemoteException , RemoveException 149 { 150 throw new CreateException(); 151 } 152 153 154 155 public void ejbPostCreate() {} 156 157 public void ejbActivate() throws RemoteException {} 158 159 public void ejbPassivate() throws RemoteException {} 160 161 public void ejbRemove() throws RemoteException , RemoveException {} 162 163 165 public void ejbStore() throws RemoteException 166 { 167 isDirty = false; 168 } 169 171 public void ejbLoad() throws RemoteException 172 { 173 isDirty = false; 174 } 175 176 193 public void setEntityContext(EntityContext context) throws RemoteException 194 { 195 entityContext = context; 196 } 197 198 215 public void unsetEntityContext() throws RemoteException 216 { 217 entityContext = null; 218 } 219 220 227 public boolean isModified() 228 { 229 return isDirty; 230 } 231 232 233 } 234 | Popular Tags |