File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes DAO methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "DAO methods" Watch "DAO methods" New topic

DAO methods

Miguel Cardenete

Joined: May 31, 2011
Posts: 5
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.

What is better?

Assume car is hibernate entity and carDAO is car DAO

I agree. Here's the link:
subject: DAO methods
jQuery in Action, 3rd edition