我最近在我的 user 和 user_audit 表中添加了一个新列“PASSWORD_RESET_REQUIRED”。
不是当我尝试删除用户时,我收到一条错误消息:
无法将 NULL 插入 ("USER_AUD"."PASSWORD_RESET_REQUIRED")
@Entity
@Table(name = "sec_user", schema = "RZUL_DATA")
//Override the default Hibernate delete and set the termination date rather than deleting the record from the db.
@SQLDelete(sql = "UPDATE RZUL_DATA.sec_user SET trmn_dt = sysdate WHERE user_id = ?")
@Audited
public class User {
@NotEmpty
@Column(name = "password_reset_required", updatable = true, insertable = true)
private String isPasswordResetRequired;
... other properties
}
我的 UserDao 删除方法:
@Override
public boolean deleteUser(final User user) {
sessionFactory.getCurrentSession().delete(user);
NOTE: Till this point I can see the user.isPasswordResetRequired an a non null.
return true;
}
我可能会遗漏哪一部分?