Hey guys. Well.. My problem is great problem. I'm making a cash system (simple: bills to pay, money to get in, least one other and have the balance). My app use
JDBC with MySQL (JPA is a lot of things) and JavaFX. It´s based on MVC. The database is work fine, View classes too, so now I have a issue. End-user insert the values on system, so is save in the DB. In a point, the user needs to know what is the SUM of all bills insert at the system. I´m use a custom query that work´s fine (SELECT SUM(VALUES) FROM CASH WHERE VALUES IS NOT NULL AND DATE='a date select by the user'). At console of MySQL this query return to me that I need. Now THE PROBLEM: I create a method to use this custom query, but at the view class is return a error of NULLPOINTEREXCEPTION.
Folow the basic classes to better understanding:
Now, I have a datePicker in a class view, where the user select a date to make this SUM, and show all values of the bills are added and show in a TextField.
1st - It´s necessary in this
pass like a parameter a date too? (like this: public Bill sumValuesBill(Bill bill, LocalDate date))???
2nd - How I create a method in a controller to get a date from datePicker and use in this method to sum this bills specific by date?
If I was not clear, I can make a video, and post in YouTube to be more clear. For now, thank´s a lot. Regards to all. Ricardo.