KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > acme > movie > MovieBean


1 package org.acme.movie;
2
3 import javax.ejb.CreateException JavaDoc;
4 import javax.ejb.EntityContext JavaDoc;
5 import javax.ejb.RemoveException JavaDoc;
6 import java.util.Date JavaDoc;
7
8 /**
9  * Bean class for the Movie EJB
10  *
11  * @author David Blevins <dblevins@visi.com>
12  */

13 public class MovieBean implements javax.ejb.EntityBean JavaDoc, Movie {
14
15     private EntityContext JavaDoc entityContext;
16     public Integer JavaDoc movieId;
17     public String JavaDoc title;
18     public String JavaDoc director;
19     public String JavaDoc genre;
20     public int rating;
21     public Date JavaDoc releaseDate;
22
23     public Integer JavaDoc ejbCreate(String JavaDoc title, String JavaDoc director, String JavaDoc genre, int rating, Date JavaDoc releaseDate) throws CreateException JavaDoc {
24         this.title = title;
25         this.director = director;
26         this.genre = genre;
27         this.rating = rating;
28         this.releaseDate = releaseDate;
29         return null;
30     }
31
32     public Integer JavaDoc getMovieId() {
33         return movieId;
34     }
35
36     public String JavaDoc getTitle() {
37         return title;
38     }
39
40     public void setTitle(String JavaDoc title) {
41         this.title = title;
42     }
43
44     public String JavaDoc getDirector() {
45         return director;
46     }
47
48     public void setDirector(String JavaDoc director) {
49         this.director = director;
50     }
51
52     public String JavaDoc getGenre() {
53         return genre;
54     }
55
56     public void setGenre(String JavaDoc genre) {
57         this.genre = genre;
58     }
59
60     public int getRating() {
61         return rating;
62     }
63
64     public void setRating(int rating) {
65         this.rating = rating;
66     }
67
68     public Date JavaDoc getReleaseDate() {
69         return releaseDate;
70     }
71
72     public void setReleaseDate(Date JavaDoc releaseDate) {
73         this.releaseDate = releaseDate;
74     }
75
76     public void ejbPostCreate(String JavaDoc title, String JavaDoc director, String JavaDoc genre, int rating, Date JavaDoc releaseDate) throws CreateException JavaDoc {
77     }
78
79     public void ejbActivate() {
80     }
81
82     public void ejbLoad() {
83     }
84
85     public void ejbPassivate() {
86     }
87
88     public void ejbRemove() throws RemoveException JavaDoc {
89     }
90
91     public void ejbStore() {
92     }
93
94     public void setEntityContext(EntityContext JavaDoc entityContext) {
95         this.entityContext = entityContext;
96     }
97
98     public void unsetEntityContext() {
99         this.entityContext = null;
100     }
101 }
102
Popular Tags