File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate--Mapping files or Annotations

 
Dinakar Kas
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the better approach for using the Hibernate in a new project? Use XML mapping files or JPA annotations?

Thanks,
Dinakar.K
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its entirely personal preference really, both have pros and cons. Some people don't like mapping data separate from the code, others don't like cluttering the code with mapping data. Both provide the same functionality.
 
Dinakar Kas
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul.

I fall in the category of people who don't like to write xml files. so, may be annotations suit me better.

I happened to see a tutorial on Hibernate using JPA at http://www.thebookonhibernate.com/HiberBookWeb/index.jsp by the author of Hibernate Made Easy and found it amazing.

Did any one read the book Hibernate Made easy? Is it as good as the tutorial given?

Thanks,
Dinakar.K
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, it's even better than the tutorial given. Really, it's one of the best books you'll ever read, right up there with "Catcher in the Rye."

Hubris aside, the book has been very popular and has helped many get started in Hibernate. I'm sure you'll love it. (I'm the author).

-Cameron McKenzie
 
Dinakar Kas
Ranch Hand
Posts: 34
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cameron. I am going today to buy it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic