I am new to ORM technolgies. I am involved in a project in its initial statges in which we have decide to go with Toplink. My question to you all is which approach to go with -
Should we go with Toplink and JPA or with Toplink API for development?
Initial analysis seems to suggest Development with Toplink API will be quick and will have more feature.
But I would like to have some expert opinions.
Thanks in advance.
You will get more features with Toplink APIs that are not implementation of the JPA spec. However, with specific APIs you become more vendor locked. But that occurs with all ORMs that implement JPA, they also have vendor specific APIs that you can use to get some extra features that the JPA spec doesn't cover.
But if you stay with the JPA spec, then you can swap out the vendor easily with any other JPA spec compliant vendor.
Personally, I would take your choice of JPA vendor, and use as much JPA spec compliant code as you can and only use vendor specific code when necessary. Sometimes you can even quarantine the vendor specific code in helper classes, but that is up to your architect if you want to take that approach.
TopLink provides extended annotations for caching, performance, locking, advanced mappings, and stored procedure queries. You can also use DescriptorCustomizers and SessionCustomizers to access most other features.
The TopLink EntityManager also gives you access to the TopLink Session and UnitOfWork interfaces to allow access to additional functionality if required.
Originally posted by Anand Sid:
Thanks Mark. As you have suggested JPA is what is preferred. Looks like we have to start fresh with JPA now .
Not sure why you have to start "fresh". I think you might be getting confused and thinking you have to either choose JPA or TopLink. Whereas it isn't an either or, it is TopLink implements JPA.
Furthermore, one other thing that I wanted to mention is that if you have already started your project using the TopLink API you can actually access the TopLink session in other parts of the app through a JPA EntityManager, so you can pick whatever API you want to use at any time without having to change existing code!
Seriously. The world's your oyster
Yes most of us here have been using Toplink API for doing a sort of Proof of Concept (POC). So we are currently comfortable using Toplink API. But after looking at JPA Api we found that the we have to change most of the API calls. Thanks for the Tip on EntityManager. But since we are in a POC phase we can change the Toplink API code written so far to JPA code. Based on you suggestion I feel that it shouldn't that difficult.
Originally posted by James Sutherland:
TopLink 11g (preview) (as well as EclipseLink) make most of the TopLink feature set available through JPA. So you can use JPA, and still get access to most of the TopLink functionality that goes beyond the JPA spec.
Hi James -
Since you have mentioned Toplink 11g. I have a question on 10g.
We are using TopLink 10.1.3.3 and also we are using Toplink workbench extensively to do mapping.
I have a few questions and I hope you could answer them -
Is it possible to get the Toplink functionalities (Not part of the JPA spec) through JPA in Toplink 10.1.3.3?
Can we use 10.1.3.3 and use the mapping done using workbench for JPA based implementation?
Thanks in Advance.