Click here to Skip to main content
15,907,328 members

Comments by Member 15471521 (Top 8 by date)

Member 15471521 7-Mar-22 9:27am View    
I came to the same conclusion, but what confuses me is that this happens the second time I hit update. So I hit update once and I get the error messages, then I hit again update, expecting to get the same error messages and I get this error. So if it finds the id the first time why is it not finding it the second time? When I debug it gets to the GET mapping, then PATCH then again GET and shows errors. Then update -> error.
Member 15471521 22-Feb-22 4:30am View    
I have updated the code - I have entity with field countBookings + getters and setters. Then in service I have a static variable which I increment and set to entity. Then below is what I have tried in service - entity.setCountBookings(bookingEntity.getCountBookings() + 1);
Member 15471521 22-Feb-22 4:28am View    
I have updated the code - I have the entity with the field countBookings + getters and setters.
Member 15471521 20-Jan-22 13:29pm View    
Sorry, I found where the mistake is, I was checking the dates 28-29 with wrong roomId and expecting something else. Now I get data when there is a match and no data when there is no match which is what I expect. It works for now :) Thank you so much.
Member 15471521 20-Jan-22 13:09pm View    
Yes, that is correct, empty set result for the propertyId=2 with room id=3 (not in the DB). However shouldn't this query return something if there is a match? For example I tried b.check_in > '2022-01-28' and b.check_out < '2022-01-29', b.property_id = 1, br.room_id = 1 but it returns nothing. My idea was to check if a room is/is not booked (that is - is/is not in the booked_rooms table).Probably I am not going about it the right way.