-->
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.  [ 5 posts ] 
Author Message
 Post subject: Java 5 Annotations and Hibernate
PostPosted: Wed Mar 16, 2005 7:14 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
I'm migrating to Hibernate 3 and am trying to understand the benefits of utilizing Java 5 Annotations versus XDoclet for Hibernate mappings.

Since annotations can be included and read an runtime, it could be inferred that Hibernate XML Mappings (HBM.XML files) are no longer necessary. Do the Hibernate annotations replace HBM.XML files completely, or are the HBM.XML files generated from the annotations?

If the files are still generated, how do I accomplish this once all my source is annotated? Is there another Ant task I should look into?

Thank you for any and all help.


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

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The annotations can stand alone. Annotated code does not generate HBMs to operate correctly. The annotation binder does its work to populate a configuration class (as does the HBM and the JDBC binder). There are examples to getting annotated POJOs working correctly. Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 16, 2005 7:50 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
Thank you, David. That's an excellent idea to have the classes stand alone.

As a follow up question, does the Eclipse Console Tool for Hibernate 3 support these classes with annotations? In other words, for my "hibernate.cfg.xml" file, do I reference the non-existant HBM.XML files, or the annotated classes themselves?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 6:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the console does not have support for loading annotated classes yet. it will get it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 10:29 am 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
Thank you for the reply, Max.

For archives, the console version at the time of this post is Hibernate Tools 3.0 alpha 1.


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