私はこのエラーを受け取り続けます:
Error saving identity in IdentityDaoImpl. Reason: org.hibernate.PropertyValueException: not-null property references a null or transient value: com.domain.Identity.password
OneToOneToOneマッピングベースで3つのテーブルをマッピングしました。
ユーザー->アカウント->ID
私が今持っている方法では、IdentityはAccountを拡張し、AccountはUserを拡張します。
たぶん私は正しくマッピングしていません。2つではなく3つの1対1の関係があるので、少し注意が必要です...
これを行う正しい方法は何ですか?
編集1:
すべてのmerge()メソッドをsave()に変更しましたが、問題は修正されませんでした。
編集2:
これが私のエンティティのクリーンバージョンです:
@Entity()
@Table(name = "`user`")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(discriminatorType = DiscriminatorType.STRING, name = "type")
@DiscriminatorValue("")
public class User extends ActionSupport implements UserDetails, Serializable {
private static final long serialVersionUID = -7480567862246640031L;
private Integer ID;
private String type;
private String password;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
public Integer getID() {
return ID;
}
public void setID(Integer ID) {
this.ID = ID;
}
@Column(name = "type", nullable = false, unique = false, length = 255)
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
@Column(name = "password", nullable = false, length = 255)
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}