Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DAO methods  RSS feed

 
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?


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!