Skip to content
Advertisement

How to check not null date in spring jpa

I have 2 IF. If No 1, is work for me. Because i wont if data is present and get house keeping == null. for action to update condition,status,and housekeeping.

IF no 2, no work for me. I wont if getData is present and get housekeeping is availabe / not null. For action only to update condition

Only check ‘null’, but not for ‘not null’. I wont check null and not null is work for me

NB : getData.isPresent = Integer , getHouseKeeping = Date

Full code :

Advertisement

Answer

I faced somewhat similar issue with comparing null. Try doing the following :

Here we have changed the arrangement of if-elseif to nested if-else. I hope it helps.

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