-->
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.  [ 4 posts ] 
Author Message
 Post subject: Annotations - general questions
PostPosted: Thu Jan 21, 2010 5:17 pm 
Newbie

Joined: Thu Jan 21, 2010 5:13 pm
Posts: 7
Hey guys, I have a few general questions regarding annotations.

[*] How do Hibernate annotations relate to javax annotations? When should I use which?
[*] Are annotations preferred now to hbm.xml files?
[*] What is required to have Hibernate annotations running (what kind of server etc. or no server perhaps?)

Best,
Mikey


Top
 Profile  
 
 Post subject: Re: Annotations - general questions
PostPosted: Fri Jan 22, 2010 9:48 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
>>[*] How do Hibernate annotations relate to javax annotations? When should I use which?

Javax-annotations are JPA-standard while Hibernate annotations are non-standard extensions.
If you want to be 'standard' and keep open the possibility to switch in future to another JPA-implementor,
then use javax annotations only. Otherwise don't hesitate to use Hibernate annotations too.

[*] Are annotations preferred now to hbm.xml files?

Both approaches are still supported as I know.
The annotations approach is more modern and is a standard (JPA)

[*] What is required to have Hibernate annotations running (what kind of server etc. or no server perhaps?)

There's no server, as I know.
Just include hiberante-annotations.jar in your classpath (with future version hibernate 3.5 all will be incorporated into hiberante3.jar)


Top
 Profile  
 
 Post subject: Re: Annotations - general questions
PostPosted: Fri Jan 22, 2010 11:42 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Annotations, or JPA annotations, are available as a separate jar file from the Hibernate core. You just download the jar and put it on your classpath, and you can use the annotations.

And just for not, in Hibernate 3.5, I believe the annotations are all bundled together with the core. Up to 3.4, the core and annotations are downloaded from hibernate.org separately.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Annotations - general questions
PostPosted: Sun Jan 24, 2010 8:52 am 
Newbie

Joined: Thu Jan 21, 2010 5:13 pm
Posts: 7
Thanks a lot for your answers!


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