-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Steps to use hibernate2
PostPosted: Sun Aug 22, 2004 2:03 am 
Newbie

Joined: Sat Aug 21, 2004 12:22 am
Posts: 3
Hibernate version:
2.1.6

Just want to ask the method of design in database and object (POJO).
By using hibernate2,
Step 1: Database Schema Design
Step 2: Writing the (.hbm.xml) mapping
Step 3: hbm -> POJO
Step 4: Writing the Java class to do insert, update, select and delete.

Is there any missing steps?

I am using Struts and Hibernate2 to do the query. The logic should be done in Struts Action level or in POJO?
Also, I want to ask if I want to use EJB steps?

Newbie Lic


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 22, 2004 4:04 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
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

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.