-->
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: hbm2java vs XDoclet
PostPosted: Wed Mar 16, 2005 4:23 pm 
Beginner
Beginner

Joined: Wed Mar 16, 2005 4:07 pm
Posts: 22
all,

i am starting a new project with new db schema, no legacy data. i have two choices on how to keep hbm mapping files and java class files in sync:

1) write all the hibernate mappings in hbm file and generate Java class files using hbm2java. if i need customized behavior, i can always subclass the generated java class. (it will look like this: foo.hbm.xml -> FooBase.java -> Foo.java, where FooBase.java is generated by hbm2java and any customization goes into Foo.java which extends FooBase.java)

2) write the Java class myself and then use XDoclet to generate mapping files. my experience with XDoclet (working with hibernate and other technologies) has been that it may not be able to provide all the features. so i am a little bit hesitant.

would you share your experience? pros and cons? many thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 16, 2005 7:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Short term: Either is a fine approach. I have always tended toward XDoclet as it feel more comfortable to me. XDoclet 1.2.2 is good for the majority of requirements. XDoclet 2.0 has more support for Hibernate. Neither currently have full support for all mappings (and limited/no support for v3.x as yet). hbm2java works very well. Since your working at the hbm level no limits to functionality at the mapping level exist but currently hbm2java does not work with all Hibernate 3.x features as yet. This is changing as we speak since tools are a major focus at the moment.

Long term: XML will still be available but annotations are likely to be the primary development approach. H3.x has annotation support (still a bit limited) but work is proceeding along. The implication is that both the above technologies will be become legagy at some point.

Your choice is not that easy since we are in a priod of change. Having said that it will be years before Java 5.0 is common in business environments so either approach is viable for the short to medium period. Pick what ever you (and your team) finds the most comfortable.


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.