File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Toplink witth JPA vs Toplink API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Toplink witth JPA vs Toplink API" Watch "Toplink witth JPA vs Toplink API" New topic
Author

Toplink witth JPA vs Toplink API

Anand Sid
Greenhorn

Joined: Dec 16, 2007
Posts: 7
Hi ORM experts -
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.
Anand
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Speed really won;t be the factor here, it is the same speed.

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.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Anand Sid
Greenhorn

Joined: Dec 16, 2007
Posts: 7
Thanks Mark. As you have suggested JPA is what is preferred. Looks like we have to start fresh with JPA now .
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
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.

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.


TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

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.

Mark
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Mark is right (as usual :-). It is not an either/or, and if you are thinking that you already know the TopLink API and don't want to have to learn a different API then you need not fear. Anyone that is familiar with TopLink, Hibernate, or any other popular ORM API for that matter, will be able to pick up JPA in no time.

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


-Mike
Pro JPA 2: Mastering the Java Persistence API
Anand Sid
Greenhorn

Joined: Dec 16, 2007
Posts: 7
First of all Thanks to you all - Mike, Mark and James for all you suggestions.
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.
Anand Sid
Greenhorn

Joined: Dec 16, 2007
Posts: 7
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Toplink witth JPA vs Toplink API