There is an issue in your code part below:
List <LMSBook> books = LMSBookLocalServiceUtil.getLMSBooks(0, -1);
It says limit 0 to -1 which is not correct.
In order to get all records you should use below code:
List <LMSBook> books = LMSBookLocalServiceUtil.getLMSBooks(-1, -1);
If you use -1 as start and end, it will return all the records.