Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Spring orm toplink to eclipselink(Migration of spring.orm.toplink.* to eclipselink)
Spring orm toplink to eclipselink [message #1858511] Wed, 05 April 2023 13:54 Go to next message
Sanjana C is currently offline Sanjana CFriend
Messages: 31
Registered: December 2022
Member
Hi,

As a part of migration from toplink to eclipselink we are using few apis of toplink from spring orm framework in project .

In few classes we are using
org.springframework.orm.toplink.UnitOfWorkCallback() class which should implemet doInUnitOfWork(oracle.toplink.sessions.UnitOfWork unitOfWork) abstract method and org.springframework.orm.toplink.TopLinkCallbackinterface where we implement
doInTopLink(Session session) method.

But when using eclipselink with spring jpa , how can we replace this above classes ?

Re: Spring orm toplink to eclipselink [message #1858524 is a reply to message #1858511] Wed, 05 April 2023 19:07 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 54
Registered: December 2021
Member
You are not replacing TopLink with EclipseLink, but replacing Spring's TopLink framework with JPA centered ones - Spring essentially removed native TopLink/EclipseLink api support, and instead built EclipseLink support into its existing JPA framework.

In this case, you would use https://docs.spring.io/spring-framework/docs/2.5.x/javadoc-api/org/springframework/orm/jpa/JpaCallback.html and use the EntityManager api. This just wraps UnitOfWork instances - if you want to continue using UOWs directly, you just need to unwrap it:
UnitOfWork uow = entityManager.unwrap(UnitOfWork.class);

Or via api described here https://wiki.eclipse.org/EclipseLink/Examples/JPA/EMAPI#JPA_1.0

Best Regards,
Chris
Previous Topic:Ping test failed error
Next Topic:Exclude field when creating history table by using @Customizer
Goto Forum:
  


Current Time: Fri Apr 26 09:41:53 GMT 2024

Powered by FUDForum. Page generated in 0.04088 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top