001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: Program.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.entity.entitytest03;
025:
026: import java.util.List;
027:
028: import javax.persistence.GeneratedValue;
029: import javax.persistence.GenerationType;
030: import javax.persistence.Id;
031: import javax.persistence.ManyToMany;
032: import javax.persistence.MappedSuperclass;
033:
034: /**
035: * The study program.
036: * @author Gisele Pinheiro Souza
037: * @author Eduardo Studzinski Estima de Castro
038: *
039: */
040: @MappedSuperclass
041: public class Program {
042:
043: /**
044: * The program identifier.
045: */
046: private Long programId;
047:
048: /**
049: * The program name.
050: */
051: private String name;
052:
053: /**
054: * The courses list for this program.
055: */
056: private List<Course> courses;
057:
058: /**
059: * Returns the courses of this program.
060: * @return the courses.
061: */
062: @ManyToMany
063: public List<Course> getCourses() {
064: return courses;
065: }
066:
067: /**
068: * Sets the courses.
069: * @param courses the courses.
070: */
071: public void setCourses(final List<Course> courses) {
072: this .courses = courses;
073: }
074:
075: /**
076: * Returns the program name.
077: * @return the name.
078: */
079: public String getName() {
080: return name;
081: }
082:
083: /**
084: * Sets the program name.
085: * @param name the name.
086: */
087: public void setName(final String name) {
088: this .name = name;
089: }
090:
091: /**
092: * Returns the program identifier.
093: * @return the identifier.
094: */
095: @Id
096: @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="PROGRAM_SEQ")
097: public Long getProgramId() {
098: return programId;
099: }
100:
101: /**
102: * Sets the program identifier.
103: * @param programId the program identifier.
104: */
105: public void setProgramId(final Long programId) {
106: this.programId = programId;
107: }
108:
109: }
|