| 1 package team; 2 3 import java.util.Collection ; 4 import javax.ejb.*; 5 6 11 public abstract class PlayerBean implements EntityBean, PlayerLocalBusiness { 12 private EntityContext context; 13 14 20 public void setEntityContext(EntityContext aContext) { 21 context = aContext; 22 } 23 24 27 public void ejbActivate() { 28 29 } 30 31 34 public void ejbPassivate() { 35 36 } 37 38 41 public void ejbRemove() { 42 43 } 44 45 48 public void unsetEntityContext() { 49 context = null; 50 } 51 52 55 public void ejbLoad() { 56 57 } 58 59 62 public void ejbStore() { 63 64 } 65 67 69 public abstract String getPlayerId(); 70 public abstract void setPlayerId(String id); 71 72 public abstract String getName(); 73 public abstract void setName(String name); 74 75 public abstract String getPosition(); 76 public abstract void setPosition(String position); 77 78 public abstract Double getSalary(); 79 public abstract void setSalary(Double salary); 80 81 83 public String ejbCreate(String playerId, String name, String position, Double salary) throws CreateException { 84 if (playerId == null) { 85 throw new CreateException("The field \"id\" must not be null"); 86 } 87 88 setPlayerId(playerId); 90 setName(name); 91 setPosition(position); 92 setSalary(salary); 93 94 return null; 95 } 96 97 public void ejbPostCreate(String playerId, String name, String position, Double salary) { 98 100 } 101 public Collection getLeagues() throws FinderException { 103 PlayerLocal player = (PlayerLocal) context.getEJBLocalObject(); 104 105 return ejbSelectLeagues(player); 106 } 107 108 public Collection getSports() throws FinderException { 109 PlayerLocal player = (PlayerLocal) context.getEJBLocalObject(); 110 111 return ejbSelectSports(player); 112 } 113 public abstract Collection getTeams(); 114 115 public abstract void setTeams(Collection teams); 116 117 public abstract Collection ejbSelectLeagues(PlayerLocal p0) throws FinderException; 118 119 public abstract Collection ejbSelectSports(PlayerLocal p0) throws FinderException; 120 } 121 | Popular Tags |