@Column(name = "password", nullable = false)
@JSonIgnore
private String password;
I have given the above field in my model class, but It did not work for the POST method.
Error:null value in column "password" violates not-null constraint
Add @JsonIgnore only on getter method.
@Column(name = "password", nullable = false)
private String password;
@JsonIgnore
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
or
@JsonProperty(access = Access.WRITE_ONLY)
@Column(name = "password", nullable = false)
private String password;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With