6215N/A/*
6215N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
6215N/A *
6215N/A * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
6215N/A *
6215N/A * The contents of this file are subject to the terms of either the GNU
6215N/A * General Public License Version 2 only ("GPL") or the Common Development
6215N/A * and Distribution License("CDDL") (collectively, the "License"). You
6215N/A * may not use this file except in compliance with the License. You can
6215N/A * obtain a copy of the License at
6215N/A * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
6215N/A * or packager/legal/LICENSE.txt. See the License for the specific
6215N/A * language governing permissions and limitations under the License.
6215N/A *
6215N/A * When distributing the software, include this License Header Notice in each
6215N/A * file and include the License file at packager/legal/LICENSE.txt.
6215N/A *
6215N/A * GPL Classpath Exception:
6215N/A * Oracle designates this particular file as subject to the "Classpath"
6215N/A * exception as provided by Oracle in the GPL Version 2 section of the License
6215N/A * file that accompanied this code.
6215N/A *
6215N/A * Modifications:
7102N/A * If applicable, add the following below the License Header, with the fields
7102N/A * enclosed by brackets [] replaced by your own identifying information:
7102N/A * "Portions Copyright [year] [name of copyright owner]"
6215N/A *
6215N/A * Contributor(s):
6215N/A * If you wish your version of this file to be governed by only the CDDL or
6215N/A * only the GPL Version 2, indicate your decision by adding "[Contributor]
6215N/A * elects to include this software in this distribution under the [CDDL or GPL
6215N/A * Version 2] license." If you don't indicate a single choice of license, a
6215N/A * recipient has the option to distribute your version of this file under
6215N/A * either the CDDL, the GPL Version 2 or to extend the choice of license to
6215N/A * its licensees as provided above. However, if you add GPL Version 2 code
6215N/A * and therefore, elected the GPL Version 2 license, then the option applies
6215N/A * only if the new code is made subject to such option by the copyright
6215N/A * holder.
6215N/A */
6215N/A
6215N/Apackage myapp;
6215N/A
6215N/Aimport javax.persistence.*;
6215N/Aimport java.util.Collection;
6215N/A
6215N/A
6215N/A@Entity
6215N/A@Table(name="BV_PROJ")
6215N/Apublic class Project {
6215N/A
6215N/A private int id;
6215N/A private String name;
6215N/A private Collection<Employee> employees;
6215N/A
6215N/A public Project() {}
6215N/A
6215N/A public Project(int id, String name) {
6215N/A this.id = id;
6215N/A this.name = name;
6215N/A }
6215N/A
6215N/A @Id
6215N/A public int getId() {
6215N/A return id;
6215N/A }
6215N/A public void setId(int id) {
6215N/A this.id = id;
6215N/A }
6215N/A
6215N/A @Column(length=20, name="NAME")
6215N/A public String getName() {
6215N/A return name;
6215N/A }
6215N/A public void setName(String name) {
6215N/A this.name = name;
6215N/A }
6215N/A
6215N/A @ManyToMany(cascade = CascadeType.ALL)
6215N/A public Collection<Employee> getEmployees() {
6215N/A return employees;
6215N/A }
6215N/A public void setEmployees(Collection<Employee> employees) {
6215N/A this.employees = employees;
6215N/A }
6215N/A
6215N/A}
6215N/A