• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone suggest me a good book on hibernate ?

 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I am new to Hibernate. Was searching for a book for it.
Can anyone suggest me a good book on hibernate ?

Thanks,
Gayatri
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Hibernate in Action and like it. The examples are clear, and it get's you started pretty quickly. What I feel is missing in both the Hibernate and Spring worlds is a book for the non-beginner that covers best practices for real-world difficult problems. But if you're just getting started with Hibernate, it's a great book.

It's written by Christian Bauer and Gavin King, the main developers of Hibernate.
 
William Siu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate in Action is a very good book. It touches on the rationale behind the design and application of Hibernate.

Hibernate - A Developer's Notebook from Oreilly is good for beginner. It is practical, hands-on with examples. What I like most is the structure of each topic. 1st - How do I do that? (What to do), 2nd - What just happened? (explain why), 3rd - What about (more explanation or extension).
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, William!

Did you find that HaDN was still useful with HiA? Or did HiA cover most of the information in HaDN? I did note that HiA was a little short on setting up the environment.
 
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't, myself, read HiA. HaDN was a very good resource, though, for getting my first medium-scale project up and running using Hibernate, so I can't more highly recommend it. (Then again, I've liked the series so far - very good for getting a running start on the technologies, and I own the Tiger, Hibernate and Mono books...)
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HaDN was a very good resource, though, for getting my first medium-scale project up and running using Hibernate, so I can't more highly recommend it.


could you find in it how to map inheritance?
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HiA definitely covers all of the inheritence mapping options. For your specific case, check out this very similar thread.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to echo the recommendation for "Hibernate in Action". I've got "Professional Hibernate" from WROX and I like HiA much better.
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone. I got my copy of Hibernate in Action.
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can, please reply to this thread after you have a good feel for the book and let us (and more importantly, the next person with this same question) know how well it satisfied your needs.
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been reading Hibernate in Action.
Its a good book but I feel there are a few topics which I am unable to understand from it.
Associations in chapter 3 and cascade persistence of chapter 4 are two topics till now I am unable to clear my concepts on.
I looked at the documentation on hibernate.org but it wasn't of much help.
Can anyone guide me on these 2 topics ?

Thanks,
Gayatri
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you phrase specific questions on those topics? Those topics are pretty large, and I doubt I could summarize them better than the book in a timely manner. But some of us here might be able to answer your questions.
 
Sathya Srinivasan
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used "Hibernate in Action" and the default documentation that comes with Hibernate (Hibernate Quick Reference) to learn Hibernate.

I have been using it extensively in the project now and feel that these books do the job.

If you have specific questions regarding using Hibernate, both this forum and the Hibernate Forum are very active and are full of large-hearted souls willing to share their experience!
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I also read Hibernate in Action.

thanks
daniel
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am unable to understand the difference between persistence by reachablity and persistence by cascading.

If you look at page 110 of Hibernate in Action, the last 2 lines of the page say :
"The cascade attribute tells Hibernate to make any new Bid instance persistence (that is, save it in the database) if the Bid is referenced by a persistent Item."

Isn't this similar to Persistence by reachability ?

What I understand of Persistence by reachability (correct me if I am wrong ) is :

Whenever a transient object is referenced by another object which is persistent, then the transient object becomes persistent. But if persistent object becomes transient, it is removed from the db but can't be removed from memory because it maybe referenced by some other objects and Hibernate has no algorithm to find out objects which are not referenced by anyone to delete them from memory.

So what is the difference between the two ?
Can anyone please advise ?

Thanks,
-Gayatri
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gayatri Ganesh:
I am unable to understand the difference between persistence by reachablity and persistence by cascading.
Look at the last paragraph of 4.3 on page 131.
There is more than one model for transitive persistence. The best known is persistence by reachability, which we'll discuss first. Although some basic principles are the same, Hibernate uses its own, more powerful model, as you'll see later.

[ My emphasis in bold ]
The next section (4.3.1) then describes the concept of persistence by reachability but concludes with this (last sentence on page 132):
Let's look at Hibernate's more flexible transitive persistence model.
The authors' self-contratulating aside, the point is that Hibernate doesn't use persistence by reachability. Instead it uses its own form of it called transitive persistence.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic