1 27 28 34 package olstore.entity; 35 36 import javax.ejb.EntityBean; 37 38 import olstore.entity.AddressLocal; 39 40 import java.util.Collection; 41 42 98 99 public abstract class UserBean implements EntityBean { 100 101 106 public java.lang.String ejbCreate(String username, String role,String lname, String fname, String emailAdd, String phoneNum, String passwd) throws javax.ejb.CreateException { 107 setUsername (username); 108 setLname (lname); 109 setFname (fname); 110 setEmailAdd (emailAdd); 111 setPhoneNum (phoneNum); 112 setPasswd (passwd); 113 setRole (role); 114 return null; 115 } 116 117 121 public void ejbPostCreate(String username, String role, String lname, String fname, String emailAdd, String phoneNum, String passwd) throws javax.ejb.CreateException { 122 } 123 124 136 public abstract java.lang.String getUsername(); 137 138 145 public abstract void setUsername(java.lang.String username); 146 147 159 public abstract java.lang.String getFname(); 160 161 168 public abstract void setFname(java.lang.String fname); 169 170 182 public abstract java.lang.String getLname(); 183 184 191 public abstract void setLname(java.lang.String lname); 192 193 205 public abstract java.lang.String getEmailAdd(); 206 207 214 public abstract void setEmailAdd(java.lang.String emailAdd); 215 216 228 public abstract java.lang.String getPhoneNum(); 229 230 237 public abstract void setPhoneNum(java.lang.String phoneNum); 238 239 251 public abstract java.lang.String getPasswd(); 252 253 260 public abstract void setPasswd(java.lang.String passwd); 261 262 274 public abstract java.lang.String getRole(); 275 276 283 public abstract void setRole(java.lang.String role); 284 285 298 299 public abstract AddressLocal getAddress (); 300 301 308 309 public abstract void setAddress (AddressLocal userAddress); 310 311 324 325 public abstract Collection getOrders (); 326 public abstract void setOrders (Collection orders); 327 328 342 343 public abstract Collection getFriends (); 344 345 356 357 public abstract void setFriends (Collection friends); 358 359 373 374 public abstract Collection getPurchased (); 375 376 383 384 public abstract void setPurchased (Collection purchased); 385 386 393 394 public boolean isAdmin () { 395 String role = getRole(); 396 if ( role != null && ! role.equals("") && role.equals( "admin" ) ) { 397 return true; 398 } else { 399 return false; 400 } 401 } 402 403 } 404 | Popular Tags |