take a look at
http://www.hibernate.org/102.html
if this is a new project, i prefer modeling the domain model (pojo).
This allows you reusability and more _core_ business logic in the model.
Quote:
I am using Struts and Hibernate2 to do the query. The logic should be done in Struts Action level or in POJO?
Surely not in action level , what will happen if tomorrow there is a Strots more powerfull that struts ? you'll have to rewrite 50% of your app.
So you can use:
- struts for UserInterface management
- a home made layers which calls technical services, DAO and complex business rules (we cannot put in the domain model) --> service or business layer
- a DataAccess Layer (also called DAO for Data Access Object) in which you code every call of hibernate.
- and your domain model (pojo) which can contain a lot of business rules
the best you have to do is to read hibernate in action or search the forum, there are many posts about it