KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > entity > entitytest03 > Program


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: Program.java 975 2006-07-28 11:14:14Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest03;
26
27 import java.util.List JavaDoc;
28
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.ManyToMany;
33 import javax.persistence.MappedSuperclass;
34
35 /**
36  * The study program.
37  * @author Gisele Pinheiro Souza
38  * @author Eduardo Studzinski Estima de Castro
39  *
40  */

41 @MappedSuperclass
42 public class Program {
43
44     /**
45      * The program identifier.
46      */

47     private Long JavaDoc programId;
48
49     /**
50      * The program name.
51      */

52     private String JavaDoc name;
53
54     /**
55      * The courses list for this program.
56      */

57     private List JavaDoc<Course> courses;
58
59     /**
60      * Returns the courses of this program.
61      * @return the courses.
62      */

63     @ManyToMany
64     public List JavaDoc<Course> getCourses() {
65         return courses;
66     }
67
68     /**
69      * Sets the courses.
70      * @param courses the courses.
71      */

72     public void setCourses(final List JavaDoc<Course> courses) {
73         this.courses = courses;
74     }
75
76     /**
77      * Returns the program name.
78      * @return the name.
79      */

80     public String JavaDoc getName() {
81         return name;
82     }
83
84     /**
85      * Sets the program name.
86      * @param name the name.
87      */

88     public void setName(final String JavaDoc name) {
89         this.name = name;
90     }
91
92     /**
93      * Returns the program identifier.
94      * @return the identifier.
95      */

96     @Id
97     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PROGRAM_SEQ")
98     public Long JavaDoc getProgramId() {
99         return programId;
100     }
101
102     /**
103      * Sets the program identifier.
104      * @param programId the program identifier.
105      */

106     public void setProgramId(final Long JavaDoc programId) {
107         this.programId = programId;
108     }
109
110 }
111
Popular Tags