Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO methods

 
Miguel Cardenete
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that place is best to include methods related to an model entity, In the entity or DAO.
In the DAOs is good practice to include search methods related to all entities. findAll, findxxx, etc. .. but what happens if the method is related to a particular entity should be within the hibernate entity for example, or within the DAO passing the entity as parameter.
Ex:

theCar.repare(wheel,tools);
or
carDAO.repare(theCar,wheel,tools);
What is better?

Assume car is hibernate entity and carDAO is car DAO

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic