Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Created March 21, 2018 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chathurangat/18aa600400198bcf83a9119f2ea18bca to your computer and use it in GitHub Desktop.
Save chathurangat/18aa600400198bcf83a9119f2ea18bca to your computer and use it in GitHub Desktop.
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "students")
public class Student
{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String country;
private String email;
@Column(name = "created_at")
private String createdAt;
@OneToMany(mappedBy = "student")
private List<StudentCourseEnrollment> studentCourseEnrollments;
//TODO add getters and setters for all properties
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment