Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- class Student{
- @Id
- private Long id;
- @OneToMany(mappedBy = "student",
- cascade = { CascadeType.PERSIST, CascadeType.MERGE,
- CascadeType.REFRESH })
- private List<Attendance> attendances;
- }
- @Entity
- class Attendance{
- @ManyToOne
- @JoinColumn(name = "id")
- private Student student;
- }
- select P.id, N from Student s left join s.attendances, IN(s.attendances) as N;
Add Comment
Please, Sign In to add comment