Hibernate: CRUD Generic DAO
My web application has got a lot of service tables/entities, such as payment_methods , tax_codes , province_codes , etc. Each time I add a new entity, I have to write a DAO. The thing is that, basically, they are all the same, but the only difference is the entity class itself . I know that Hibernate tools can generate the code for me automatically but I can't use them now (don't ask why) so I'm thinking of a Generic DAO . There's a lot of literature about that but I can't put pieces together and make it work with Spring. It's all about generics I think, it will have four basic methods: