I need to have a method to delete an order, my idea is to compare all the books that the shop has with the books that are in the order, and then increase the quantity in the stock and remove the order.
I have an error doing a loop with all the books that there are in the shop, the error is "non-static method getBooks() cannot be referenced from a static context" and I dont know to solve it.
why do you need to loop all books if you have the book id.
If you need to remove the book from an order and increase the stock with one of the bookId's book that wouldn't be a single method but 2.
You're using hibernate? So why don't use a jpa repository
It's good to be able to use someting, it's better to understand how it works.