1 package org.acme.movie; 2 3 import javax.ejb.CreateException ; 4 import javax.ejb.EntityContext ; 5 import javax.ejb.RemoveException ; 6 import java.util.Date ; 7 8 13 public class MovieBean implements javax.ejb.EntityBean , Movie { 14 15 private EntityContext entityContext; 16 public Integer movieId; 17 public String title; 18 public String director; 19 public String genre; 20 public int rating; 21 public Date releaseDate; 22 23 public Integer ejbCreate(String title, String director, String genre, int rating, Date releaseDate) throws CreateException { 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 getMovieId() { 33 return movieId; 34 } 35 36 public String getTitle() { 37 return title; 38 } 39 40 public void setTitle(String title) { 41 this.title = title; 42 } 43 44 public String getDirector() { 45 return director; 46 } 47 48 public void setDirector(String director) { 49 this.director = director; 50 } 51 52 public String getGenre() { 53 return genre; 54 } 55 56 public void setGenre(String 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 getReleaseDate() { 69 return releaseDate; 70 } 71 72 public void setReleaseDate(Date releaseDate) { 73 this.releaseDate = releaseDate; 74 } 75 76 public void ejbPostCreate(String title, String director, String genre, int rating, Date releaseDate) throws CreateException { 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 { 89 } 90 91 public void ejbStore() { 92 } 93 94 public void setEntityContext(EntityContext entityContext) { 95 this.entityContext = entityContext; 96 } 97 98 public void unsetEntityContext() { 99 this.entityContext = null; 100 } 101 } 102 | Popular Tags |