• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

quick hibernate question

 
Tony Smith
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am new to hibernate, since which version has hibernate implemented annotation? When annotation is used, does it mean you longer need to create mapping files? Thanks.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a JDK of version 5, aka 1.5 or better, you're good to go with annotations. Just download the Hibernate Core module and the Hibernate annotations module from hibernate.org, and you'll be up and running in no time.

Annotations do eliminate the need for the mapping files, which in my opinion, makes persistence modelling easier and more natural.

Please take a look at this Hibernate3 tutorial that demonstrates how to get up and running with Hibernate and JPA annotations. It's pretty thorough.

Setting up a Hibernate Environment for Data Persistence with Java

Don't struggle too much. When you've got another question, or you're having a problem, post to the ranch.

-Cameron McKenzie
 
Tony Smith
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say: makes persistence modelling easier and more natural. Why is that? Is that because you think xml files are easier to read through or? Do you make mapping first then create the tables? Is that what you mean by persistence modelling?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic