Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
@Entity
@Table(name = "courses")
public class Course implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
private String description;
private String major;
@Column(name = "created_at")
private String createdAt;
@ManyToMany(mappedBy = "courses")
private List<Student> students;
//TODO getters and setters for all properties
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment