Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @JsonInclude(Include.NON_NULL)
- @Entity
- public class Record{
- @Id
- @GeneratedValue
- private Long id;
- @OneToOne(cascade = CascadeType.ALL)
- @JoinColumn(name="user_id")
- private User user;
- .....getters and setters
- }
- @JsonInclude(Include.NON_NULL)
- @Entity
- public class User {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
- @OneToOne(cascade = CascadeType.ALL, mappedBy="user")
- private Record record;
- ....getters and setters
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement