EclipseLink Document Does Not Explain Session

I am trying to execute a query using EclipseLink after crappy documentation at http://wiki.eclipse.org/Introduction_to_EclipseLink_Expressions_%28ELUG%29 , but every time you need to execute Expression, it uses a variable called "session", but no where is it explains where this "session" variable comes from. I already have a persistence.xml file and I can run javax.persistence.Query in my database, so I know that the connection works, but I can’t figure out where the session comes from. Help a little please?

Question: I had a terrible time trying to get EclipseLink to work, although everyone says how great its comparison with Hibernate is. Is EclipseLink my time and frustration, or should I just give it up and try something like Hibernate?

thank

+5
source share
4 answers

I suggest reading this .

There are different sessions in EclipseLink. Without going into details, you can say that a session is something like a transaction. In EclipseLink, a session is often a unit of work that knows which entities have changed / added / deleted or something else.

EclipseLink JPA EntityManager API:

//EntityManagerImpl has to be imported as org.eclipse.persistence.internal.jpa.EntityManagerImpl
Session session = ((EntityManagerImpl) entityManager).getActiveSession();

, , .

+4

EclipseLink Oracle Toplink Eclipse Foundation, , Hibernate, API- persistence JPA. , Hibernate, . EclipseLink ( Hibernate, EclipseLink UnitOfWork).

JPA. JPA API, , EclipseLink Hibernate. , , , , , . "".

, JPA, JPA ( ). , .

EclipseLink, , , , , , JPA. , , ( , , , ).

Hibernate, , , .., , . , , , , Hibernate . , , Hibernate:)

+4

EclipseLink JPA. JPA- . , , JPA JPA 2.0, .

, , .

stackoverflow, EclipseLink Forum .

+2

Is EclipseLink my time and frustration, or should I just give it up and try something like Hibernate instead?

It is up to you to judge whether it’s worth it for you.

But I would like to point out that wasting time and frustration with learning new technologies are just part of the job specification for the Software Engineer. If you cannot accept this, you should seriously consider a less demanding career.

+1
source

All Articles