Witam, ja nie dostrzegam, gdzie zrobiłem błąd, zamiast OneToOne tworzy się OneToMany.
Klucz to login i ma być współdzielony, poniżej kod:
@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;
Za pomoc z góry dzięki