bug fix:Error creating bean with name ‘entityManagerFactory‘

This commit is contained in:
myh 2023-11-11 20:10:59 +08:00
parent fd72129e4e
commit b9c8cd892c
2 changed files with 11 additions and 3 deletions

View File

@ -11,8 +11,12 @@ import lombok.NoArgsConstructor;
@Table(name = "MerchantsPassword")
public class MerchantsPassword {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long merchantsID;
@OneToOne
@PrimaryKeyJoinColumn(name = "merchantID", referencedColumnName = "id")
@JoinColumn(name = "merchantsID", referencedColumnName = "id")
private Merchants merchants;
private String password;
}

View File

@ -11,8 +11,12 @@ import lombok.NoArgsConstructor;
@Table(name = "UsersPassword")
public class UsersPassword {
@Id
@OneToOne
@PrimaryKeyJoinColumn(name = "userID", referencedColumnName = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "usersID", referencedColumnName = "id")
private Users users;
private String password;
}