aspose file tools*
The moose likes Object Relational Mapping and the fly likes JPA - Hibernate Integration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA - Hibernate Integration" Watch "JPA - Hibernate Integration" New topic
Author

JPA - Hibernate Integration

Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Hi Mike,

Does your book talk about JPA - Hibernate Integration?

Thanks.


SCJP 1.5, SCEA, ICED (287,484,486)
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

JPA Hibernate integration? JPA is a standard, you can't integrate it with anything (because its not a concrete thing). Hibernate provides an implementation of that standard - are you just asking if the book covers using Hibernate?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Paul Sturrock wrote:JPA Hibernate integration? JPA is a standard, you can't integrate it with anything (because its not a concrete thing). Hibernate provides an implementation of that standard - are you just asking if the book covers using Hibernate?


Yes, I meant if book covers Hibernate. Sorry for the confusion.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Anil Vupputuri wrote:
Paul Sturrock wrote:JPA Hibernate integration? JPA is a standard, you can't integrate it with anything (because its not a concrete thing). Hibernate provides an implementation of that standard - are you just asking if the book covers using Hibernate?


Yes, I meant if book covers Hibernate. Sorry for the confusion.


No the book shouldn't cover Hibernate specific APIs. The book is about the JPA spec, in which Hibernate implements it, so you can sort of say the entire book covers Hibernate, as the entire book covers EclipseLink. But just the parts of those products that implement the JPA spec.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

JPA is a complete enough specification that in most cases, you shouldn't have any Hibernate-specific code in your ORM applications.

For one thing, the Hibernate people were heavily involved in the design of JPA, so they had plenty of opportunity to make sure their bases were covered.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Well said, boys.

That's what I love about this place. With guys like Paul, Mark and Tim around I barely have to say anything at all.


-Mike
Pro JPA 2: Mastering the Java Persistence API
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Mark Spritzler wrote:
No the book shouldn't cover Hibernate specific APIs. The book is about the JPA spec, in which Hibernate implements it, so you can sort of say the entire book covers Hibernate, as the entire book covers EclipseLink. But just the parts of those products that implement the JPA spec.
Mark


I got it, so the book covers only one JPA implementation ORM, which is EclipseLink.

I heard that instead of seperating JPA and Hibernate, we can take advantage of combining together and unleash the power of two.
By using standard JPA annotations to markup a set of POJOs and then persist the POJOs by configuring Spring to use the Hibernate. This is one type of design pattern.
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
For some reason this thread makes me think of the king/guards tower scene in Monty Python and The Holy Grail...

Let me try again.

The JPA spec defines a set of annotations, interfaces, XML schemas, and describes the behavior of all of these when implemented by a vendor and used by a developer. A number of different vendor products actually implement the JPA interfaces, including Hibernate, EclipseLink, OpenJPA and a few others. As a developer you develop a program using JPA and plug in a provider that implements the JPA interfaces. Your program should work regardless of which implementation you use as long as you develop to the JPA standard interfaces/annotations/XML. The benefit of this is that as an application developer you are not coupled to a particular persistence product and can change if you feel the need to do so, based on performance or value-add features.

The Pro JPA 2 book describes how to use these interfaces. It does not explain any of the vendor products that implements them. I repeat, it does not explain Hibernate or EclipseLink, it explains how to use JPA. If you want to decouple yourself from a persistence product then JPA is your ticket. If you are using Spring then you can still use JPA and just plug in the JPA implementation of your choice.

Now, you stay here, and make sure he doesn't leave...
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Mike Keith wrote:For some reason this thread makes me think of the king/guards tower scene in Monty Python and The Holy Grail...

Now, you stay here, and make sure he doesn't leave...


So then just OpenJPA is in your book.

I AM REALLY SORRY

Just couldn't resist.

Mark
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Mike Keith wrote:

The Pro JPA 2 book describes how to use these interfaces. It does not explain any of the vendor products that implements them. I repeat, it does not explain Hibernate or EclipseLink, it explains how to use JPA. If you want to decouple yourself from a persistence product then JPA is your ticket. If you are using Spring then you can still use JPA and just plug in the JPA implementation of your choice.


Thanks for detailed explanation. Is your book good for those who are new to ORM world.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Anil Vupputuri wrote:
Mike Keith wrote:

The Pro JPA 2 book describes how to use these interfaces. It does not explain any of the vendor products that implements them. I repeat, it does not explain Hibernate or EclipseLink, it explains how to use JPA. If you want to decouple yourself from a persistence product then JPA is your ticket. If you are using Spring then you can still use JPA and just plug in the JPA implementation of your choice.


Thanks for detailed explanation. Is your book good for those who are new to ORM world.


Their books are always great for everyone, even you next door neighbor the accountant. ;)

Mark
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Their books are always great for everyone, even you next door neighbor the accountant.

Not just accountants. Tax consultants, real estate agents, management execs and stockbrokers all use it to keep loose papers from flying off.
Rob Ivan
Greenhorn

Joined: Jan 07, 2010
Posts: 28

What about wan princes--can't leave them out!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA - Hibernate Integration
 
Similar Threads
How to persist an Object
Comparing Persistence Frameworks
What to learn after basics of servlets and JSP?
[Stripes + Hibernate] question on db fields type
Spring Persistence With Hibernate: Spring JDBC vs Hibernate ORM