Best offers:
1) Use Hibernate. Then you will use the criteria API, you will not need to specify the "Personality" excessively and can join other restrictions / criteria in a modular way - useful for list / search pages.
2) Call the getByName () API. The list people = personDao.getPersonByName ("...") is already redundantly repeated.
It all looks like the βwrong wayβ to do DAO, database access or persistence, as I saw in previous projects. The combination of too verbose, but inflexible and of little use criteria simply reminds me of hand-written perseverance or services done poorly in the mid-90s.
Thomas w
source share