I'm doing a web-based, administrative software, it has several graphs and several tables, the problem with this is that several graphs and tables generate many queries to the database, and with this, many classes that have a similar structure, For example, for the graphs all have the date attribute, an array of integers or dates, I would like to write a more elegant code, so that with only one repository class I could bring the date values generically, I even created a single class using the Generics java that does the basic operations for each entity of the bank (select, update, delete, list ...), it was much better, works well and reduced me some 500 lines of code (there are 18 entities ...) I would like to do something like that for the dates.
As I'm new to hibernate, I'm having trouble visualizing how I can do this generically, there might be an API that already does this ... I accept anything to improve the code. And of course, is this a good option? to implement a generic class for all graphics or one class for each?