Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table(name = "user")
- public class User {
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
- @Column(unique=true)
- @Id
- private String login;
- private String password;
- private String firstName;
- private String lastName;
- private String city;
- private int age;
- private Sex sex ;
- @OneToOne(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.ALL)
- private UserProfile userProfile;
- @Entity
- @Table(name = "user_profile")
- public class UserProfile {
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long Id;
- @Id
- private String login;
- private String user_interestings;
- @OneToOne
- @MapsId
- private User user;
Add Comment
Please, Sign In to add comment