-->
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.  [ 3 posts ] 
Author Message
 Post subject: Annotations Vs HBM2Java
PostPosted: Sat Dec 16, 2006 7:21 pm 
Newbie

Joined: Tue Mar 07, 2006 3:37 am
Posts: 4
Hello,

We are starting a new project under Hibernate, and we would like to know which way is the best or easiest to work with.

1) Use HBM XMLs to create/maintain schema & then feed these XMLs to Hbm2Java so that POJOs will be generated for us. Later extend these POJOs as necessary.

OR

2) Use Java Annotations in the class and use these annotations to create HBM XMLs. Opposite of #1 above.

Our development team is split on this issue.

If we use #1 above in most cases we will have to extend the POJOs. But XMLs are compact and easier to maintain. Everything you need to know about a class is usually within 20 lines.

In #2 above, the maintenace becomes cumbersome since one has to scroll up and down or look at the generated XML to see the big picture. Plus we have to create the POJOs ourselves.

Thought we would approach the Hibernate community and learn from everyone's experience.

Thanks for your time & help.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 1:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Use what your crew will be the most productive with and what the architect has planned going forward. Some factors in this choice will be determined by deployment approach and the session manager you use , eg, JPA or Hibernate native API.

Having said that - why do you need to generate the XML from Annotations?

In general, If I was looking at starting a large project today, I would seriously consider employing hibernate native Annotations and use native hibernate API.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 2:37 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Duplicate thread... Couldn't it be merged by an admin? :-)
http://forum.hibernate.org/viewtopic.ph ... highlight=

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.