SHARE
TWEET

Untitled

a guest Jan 20th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Entity
  2. class Student{
  3. @Id
  4. private Long id;
  5.     @OneToMany(mappedBy = "student",
  6.                cascade = { CascadeType.PERSIST, CascadeType.MERGE,
  7.                            CascadeType.REFRESH })
  8.   private List<Attendance> attendances;
  9. }
  10.  
  11. @Entity
  12. class Attendance{
  13.  
  14.   @ManyToOne
  15.   @JoinColumn(name = "id")
  16.  private Student student;
  17. }
  18.    
  19. select P.id, N from Student s left join s.attendances, IN(s.attendances) as N;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top