Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- public class Cellphone(){
- @Id @GeneratedValue;
- private Long id;
- private String number;
- @OneToMany(mappedBy="cellphone", cascade = CascadeType.ALL)
- @JoinColumn(name="id_cellphone")
- private List<Calls> listCalls = new ArrayList<Calls>();
- }
- @Entity
- public class Calls(){
- @Id @GeneratedValue
- private Long id;
- @Temporal
- private Date date;
- private Integer time;
- @ManyToOne
- private Cellphone cellphone;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement