Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. @Entity
  2. public class Cellphone(){
  3.  
  4. @Id @GeneratedValue;
  5. private Long id;
  6.  
  7. private String number;
  8.  
  9. @OneToMany(mappedBy="cellphone", cascade = CascadeType.ALL)
  10. @JoinColumn(name="id_cellphone")
  11. private List<Calls> listCalls = new ArrayList<Calls>();
  12. }
  13.  
  14. @Entity
  15. public class Calls(){
  16.  
  17. @Id @GeneratedValue
  18. private Long id;
  19.  
  20. @Temporal
  21. private Date date;
  22. private Integer time;
  23.  
  24. @ManyToOne
  25. private Cellphone cellphone;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement