KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > league > ejb > entity > ResultBean


1 package league.ejb.entity;
2 import java.math.BigDecimal JavaDoc;
3
4 /**
5  * This is the bean class for the Result enterprise bean.
6  * Created Mar 9, 2005 1:34:55 PM
7  * @author honza
8  */

9 public abstract class ResultBean implements javax.ejb.EntityBean JavaDoc, league.ejb.entity.ResultLocalBusiness {
10     private javax.ejb.EntityContext JavaDoc context;
11     
12     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click on the + sign on the left to edit the code.">
13
// TODO Consider creating Transfer Object to encapsulate data
14
// TODO Review finder methods
15
/**
16      * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
17      */

18     public void setEntityContext(javax.ejb.EntityContext JavaDoc aContext) {
19         context = aContext;
20     }
21     
22     /**
23      * @see javax.ejb.EntityBean#ejbActivate()
24      */

25     public void ejbActivate() {
26         
27     }
28     
29     /**
30      * @see javax.ejb.EntityBean#ejbPassivate()
31      */

32     public void ejbPassivate() {
33         
34     }
35     
36     /**
37      * @see javax.ejb.EntityBean#ejbRemove()
38      */

39     public void ejbRemove() {
40         
41     }
42     
43     /**
44      * @see javax.ejb.EntityBean#unsetEntityContext()
45      */

46     public void unsetEntityContext() {
47         context = null;
48     }
49     
50     /**
51      * @see javax.ejb.EntityBean#ejbLoad()
52      */

53     public void ejbLoad() {
54         
55     }
56     
57     /**
58      * @see javax.ejb.EntityBean#ejbStore()
59      */

60     public void ejbStore() {
61         
62     }
63     // </editor-fold>
64

65     // <editor-fold desc="CMP fields and relationships.">
66

67     public abstract java.math.BigDecimal JavaDoc getScore();
68     public abstract void setScore(java.math.BigDecimal JavaDoc score);
69     
70     public abstract java.math.BigDecimal JavaDoc getPoints();
71     public abstract void setPoints(java.math.BigDecimal JavaDoc points);
72     
73     public abstract java.math.BigDecimal JavaDoc getTeamId();
74     public abstract void setTeamId(java.math.BigDecimal JavaDoc teamId);
75     
76     public abstract java.math.BigDecimal JavaDoc getMatchId();
77     public abstract void setMatchId(java.math.BigDecimal JavaDoc matchId);
78     
79     public abstract league.ejb.entity.MatchLocal getMatch();
80     public abstract void setMatch(league.ejb.entity.MatchLocal match);
81     
82     public abstract league.ejb.entity.TeamLocal getTeam();
83     public abstract void setTeam(league.ejb.entity.TeamLocal team);
84     
85     // </editor-fold>
86

87     public league.ejb.entity.ResultPK ejbCreate(java.math.BigDecimal JavaDoc score, java.math.BigDecimal JavaDoc points, Integer JavaDoc teamId, Integer JavaDoc matchId) throws javax.ejb.CreateException JavaDoc {
88         if (score == null) {
89             throw new javax.ejb.CreateException JavaDoc("The field \"score\" must not be null");
90         }
91         if (points == null) {
92             throw new javax.ejb.CreateException JavaDoc("The field \"points\" must not be null");
93         }
94         if (teamId == null) {
95             throw new javax.ejb.CreateException JavaDoc("The field \"teamId\" must not be null");
96         }
97         if (matchId == null) {
98             throw new javax.ejb.CreateException JavaDoc("The field \"matchId\" must not be null");
99         }
100       
101         // TODO add additional validation code, throw CreateException if data is not valid
102
setScore(score);
103         setPoints(points);
104         setTeamId(new BigDecimal JavaDoc(teamId.intValue()));
105         setMatchId(new BigDecimal JavaDoc(matchId.intValue()));
106         
107         return null;
108     }
109     
110     public void ejbPostCreate(java.math.BigDecimal JavaDoc score, java.math.BigDecimal JavaDoc points, Integer JavaDoc teamId, Integer JavaDoc matchId) {
111         // TODO populate relationships here if appropriate
112

113     }
114 }
115
Popular Tags