CREATE TABLE `user_info` (
`user_info_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nickname` varchar(40) NOT NULL,
`email` varchar(100)
)
this my database table,database have A record id=1, nickname=test, email=null
UserInfo info = new UserInfo();
info.setUserInfoId(1);
info.setEmail("hello@hotmail.com");
When I update with the above code, an error Column 'nickname' cannot be null occurs!
I know this is because JPA has to perform a lookup first, but I don't want to give JPA all the values that can't be empty when updating the operation.
Additional explanation:
Assuming that my front end only sends me ID and email, how can I update it? Use SQL is feasible, but JPA must require nickname not null
How to solve this problem? thx