KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Movie


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2005 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 import java.sql.Date JavaDoc;
29
30 import javax.persistence.Entity;
31 import javax.persistence.Id;
32 import javax.persistence.JoinColumn;
33 import javax.persistence.ManyToOne;
34 import javax.persistence.OneToMany;
35
36
37 /**
38  * @author Marcel Overdijk (marceloverdijk@hotmail.com)
39  * @version $Id: Movie.java 1251 2006-05-08 14:15:01 +0300 (Mon, 08 May 2006) lucianc $
40  */

41 @Entity
42 public class Movie {
43
44     private int id;
45     private Person director;
46     private String JavaDoc title;
47     private String JavaDoc genre;
48     private Date JavaDoc releaseDate;
49
50     private java.util.Collection JavaDoc<Cast> cast;
51     private java.util.Collection JavaDoc<Varia> varia;
52     
53     public Movie() {
54     }
55     
56     public Movie(int id, Person director, String JavaDoc title, String JavaDoc genre, Date JavaDoc releaseDate) {
57         this.id = id;
58         this.director = director;
59         this.title = title;
60         this.genre = genre;
61         this.releaseDate = releaseDate;
62     }
63
64     @Id
65     public int getId() {
66         return id;
67     }
68
69     public void setId(int id) {
70         this.id = id;
71     }
72     
73     @JoinColumn(name="director")
74     @ManyToOne
75     public Person getDirector() {
76         return director;
77     }
78
79     public void setDirector(Person director) {
80         this.director = director;
81     }
82     
83     public String JavaDoc getTitle() {
84         return title;
85     }
86
87     public void setTitle(String JavaDoc title) {
88         this.title = title;
89     }
90     
91     public String JavaDoc getGenre() {
92         return genre;
93     }
94
95     public void setGenre(String JavaDoc genre) {
96         this.genre = genre;
97     }
98
99     public Date JavaDoc getReleaseDate() {
100         return releaseDate;
101     }
102
103     public void setReleaseDate(Date JavaDoc releaseDate) {
104         this.releaseDate = releaseDate;
105     }
106     
107     @OneToMany(mappedBy="movie")
108     public java.util.Collection JavaDoc<Cast> getCast() {
109         return this.cast;
110     }
111
112     public void setCast(java.util.Collection JavaDoc<Cast> cast) {
113         this.cast = cast;
114     }
115
116     @OneToMany(mappedBy="movie")
117     public java.util.Collection JavaDoc<Varia> getVaria() {
118         return this.varia;
119     }
120
121     public void setVaria(java.util.Collection JavaDoc<Varia> varia) {
122         this.varia = varia;
123     }
124 }
125
Popular Tags