KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Cast


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 javax.persistence.Entity;
29 import javax.persistence.Id;
30 import javax.persistence.JoinColumn;
31 import javax.persistence.ManyToOne;
32 import javax.persistence.Table;
33
34
35
36 /**
37  * @author Marcel Overdijk (marceloverdijk@hotmail.com)
38  * @version $Id: Cast.java 1251 2006-05-08 14:15:01 +0300 (Mon, 08 May 2006) lucianc $
39  */

40 @Entity
41 @Table(name="movie_cast")
42 public class Cast {
43
44     private int id;
45     private Movie movie;
46     private Person actor;
47     private String JavaDoc character;
48     private int importance;
49     
50     public Cast() {
51     }
52     
53     public Cast(int id, Movie movie, Person actor, String JavaDoc character, int importance) {
54         this.id = id;
55         this.movie = movie;
56         this.actor = actor;
57         this.character = character;
58         this.importance = importance;
59     }
60
61     @Id
62     public int getId() {
63         return id;
64     }
65
66     public void setId(int id) {
67         this.id = id;
68     }
69     
70     @JoinColumn(name="movie")
71     @ManyToOne
72     public Movie getMovie() {
73         return movie;
74     }
75
76     public void setMovie(Movie movie) {
77         this.movie = movie;
78     }
79     
80     @JoinColumn(name="actor")
81     @ManyToOne
82     public Person getActor() {
83         return actor;
84     }
85
86     public void setActor(Person actor) {
87         this.actor = actor;
88     }
89     
90     public String JavaDoc getCharacter() {
91         return character;
92     }
93
94     public void setCharacter(String JavaDoc character) {
95         this.character = character;
96     }
97     
98     public int getImportance() {
99         return importance;
100     }
101
102     public void setImportance(int importance) {
103         this.importance = importance;
104     }
105 }
106
Popular Tags