Skip to content
Advertisement

Boolean value not being changed in database

Hey folks I’m having a problem with my code. For some reason when I try to change the value to false, it doesn’t reflect in my SQL Database. I debugged and it does get set via Java, but it doesn’t transfer over. I’m working on a notification service class and it sets the values on there to true no problem, but my PostMapping method, it doesn’t work. I will post a snippet of code below for both the add flight where I’m trying to do the logic and also my notification service.

#############################NOTIFICATION SNIPPET#########################################

Advertisement

Answer

As far I can see: You are not updating your account after setting the notification to false. You need to persist your changes after setting it with something like accountRepository.save(a);

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement