dimanche 26 novembre 2017

Generic Repository in Java vs one Repository for each entity when we use Hibernate

What is the best way to create a good code, when you work with Hibernate in Java and you have to decide whether to use in generic repository or one specific repository for each entity.

Firstly I tried to use one generic repository, but I had some problems when I tried to write the name of the class in "Select" clauses and I ended up with one repository for each entity so I know exactly the name of the class.

What are the best practices in this case?

Aucun commentaire:

Enregistrer un commentaire