Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How can I use Hibernate, or OpenJPA with EclipseLink
How can I use Hibernate, or OpenJPA with EclipseLink [message #376358] Wed, 16 July 2008 16:41 Go to next message
Glenn is currently offline Glenn
Messages: 14
Registered: July 2009
Junior Member
I want to be able to plug in different JPA implementations in my
application without a lot of reconfiguration and be able to continue
to use the advanced annotations and capabilities of EclipseLink.

My understanding is that EclipseLink, while it uses
TopLink as its default JPA implementation, sits on top of and
allows for plugability by simply dropping in a different persistence jar,
such as Hibernate.

However, the examples on the EclipseLink wiki indicate that all the
properties
in persistence.xml have to be changed, and some (the EclipseLink-advanced
ones)
have to be removed altogether. The same holds for entity annotations. In
addition, the examples seem to indicate that the method for injecting an
EntityManager can vary depending on the JPA container.

If I want to use Hibernate with EclipseLink cache, I can't do it just by
dropping in the right jar files.

Is this correct? Any suggestions would be appreciated.

Glenn...
Re: How can I use Hibernate, or OpenJPA with EclipseLink [message #376363 is a reply to message #376358] Thu, 17 July 2008 08:43 Go to previous messageGo to next message
Eclipse User
Originally posted by: luxspes.yahoo.com

Hi!

I am sorry to inform you that what you want is impossible, you can not use
EclipseLink and then Hibernate as the internal implementation of
EclipseLink, EcliseLink and Hiberante are both internal implementations of
JPA. Trying to use Hibernate as the internal implementation of EclipseLink
would be like trying to use Oracle as the internal implementation of
SqlServer (it just doesn't make sense)

In other words EclipseLink doesn't it use
TopLink as its default JPA implementation, EclipseLink is the new name for
the OpenSource version of TopLink. The "generic" part is precisely
javax.persistence_1.0.0.jar, and the specific pluggable (replaceble part)
is eclipselink.jar (or if you want to use Hibernate, then
hibernate-core.jar, hibernate-entitymanager.jar and
hibernate-annotations.jar).

And therefore you cannot use Hibernate with EclipseLink cache.

Regards,
Re: How can I use Hibernate, or OpenJPA with EclipseLink [message #376364 is a reply to message #376358] Thu, 17 July 2008 08:52 Go to previous messageGo to next message
Gordon Yorke is currently offline Gordon Yorke
Messages: 77
Registered: July 2009
Member
Hello Glen,
EclipseLink _is_ a JPA provider and if for some strange reason you wish
to use alternate providers you will have to replace EclipseLink in its
entirety.

The statement that EclipseLink is built upon TopLink could be a little
confusing but what it means is the two products are the same code base.
TopLink having been donated to Eclipse foundation and renamed EclipseLink.

--Gordon
Re: How can I use Hibernate, or OpenJPA with EclipseLink [message #376370 is a reply to message #376364] Thu, 17 July 2008 12:30 Go to previous messageGo to next message
Glenn is currently offline Glenn
Messages: 14
Registered: July 2009
Junior Member
I appreciate all the replies. It seems others in this forum are confused
on this as well (see "JPA vs Native" discussion).

Not to belabor the point, but the intro page to the EclipseLink wiki
states:

EclipseLink will focus on providing leading edge support, including
advanced feature extensions, for the dominant persistence standards for
each target data source; Java Persistence API (JPA) for relational
databases, Java Architecture for XML Binding (JAXB) for XML, J2EE
Connector Architecture (JCA) for EIS and other types of legacy systems,
and Service Data Objects (SDO).

This does give the impression that EclipseLink is a "pluggable"
persistence framework that supports and extends the standards and not just
for JPA. It seems that such a framework that is implementation-neutral and
even allows for others to write their own enhancements, would be
worthwhile.

Glenn...
Re: How can I use Hibernate, or OpenJPA with EclipseLink [message #376372 is a reply to message #376370] Thu, 17 July 2008 15:04 Go to previous messageGo to next message
Doug Clarke is currently offline Doug Clarke
Messages: 155
Registered: July 2009
Senior Member
Glenn,

EclipseLink implements JPA, JAXB, and SDO. We work to be pluggable into
any container. EJB 3.0 enabled pluggable JPA providers and we leverage
that to plug into all compliant EJB 3.0 containers. EclipseLink is not a
container hosting various persistence implementation but is that
persistence provider.

The discussion of JPA versus Native is really about using our classic API
and metadata or using the standard API and metadata defined in JPA. This
is very similar to the decision to Hibernate's native API or to use it
through JPA.

Ultimately EclipseLink competes directly with Hibernate. We feel we offer
a much better solution in terms of flexibility and performance.

Doug
Re: How can I use Hibernate, or OpenJPA with EclipseLink [message #376373 is a reply to message #376372] Thu, 17 July 2008 15:21 Go to previous message
Doug Clarke is currently offline Doug Clarke
Messages: 155
Registered: July 2009
Senior Member
Glenn,

One more thing that just occurred to me. It should be made clear that
EclipseLink is a Runtime project at Eclipse producing a Jar or set of OSGi
bundles that you use in your application. This is not a project that
extends the Eclipse IDE.

Doug
Previous Topic:JPA Query generate uppercase field names
Next Topic:Dali Java Persistence Tools 2.0 - Feature Highlights
Goto Forum:
  


Current Time: Thu Apr 24 01:35:54 EDT 2014

Powered by FUDForum. Page generated in 0.06112 seconds