/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.test.annotations.idmanytoone; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * @author Alex Kalashnikov */ @Entity @Table(name = "idmanytoone_course_student") public class CourseStudent implements Serializable { @Id @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "course_id") private Course course; @Id @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "student_id") private Student student; @Column(name = "`value`") private String value; public CourseStudent() { } public Course getCourse() { return course; } public void setCourse(Course course) { this.course = course; } public Student getStudent() { return student; } public void setStudent(Student student) { this.student = student; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }