Oracle Open Sources TopLink Java ORM
Eric^2 writes "Oracle announced on Tuesday that TopLink will now be open source and a full-fledged Eclipse project. TopLink is an object-persistence layer for Java that maps Java objects to a relational database."
Way back in the day (2001), I was evaluating ORM solutions to replace the "roll-our-own" orm in our Java app. Took a look at Cocobase, TopLink, JDO (just appearing), and Java Relational Bridge. Hibernate was not ready for prime time (yet).
TopLink was the only offering that ate it's own database on a regular basis. I fell back to hourly saves, and making full copies of the XML text that they were using to save the O-R mapping information. At one point, I accidentally overwrote one of the prior saves and discovered that all saves over the last day had been corrupt anyway, and I gave up on the pretty tool. Then we went to fell back to hand-editing mapping files and modifying our domain objects to fit into the framework. Ouch. Lots of references to *.toplink.* appeared in the import lists. Several relationships didn't have strong support (map of named sets: had to make a new object type for the map, trinary relation: again, make a new kludge class).
Nowadays, if you don't HAVE to use stored procedures, use Hibernate. You'll have to adapt your code to it in a few small ways (cascade delete sequencing, persisting inherited properties), but basically, it just works.
Ross
WTF are you doing?
Yeah, right.
Java objects to a relational database
A "relational" database would store objects directly, avoiding this need for the clusterfuckage known as "ORM".
Question for the ORM-lovers: what class does the table returned by this query map to:
SELECT "banana" AS fruit, Customer.first_name, Order.order_id FROM Customer NATURAL JOIN Order
If, by this stage, you have suffered through not *knowing* what is wrong with your magical persistence machine, you might have some value for this.
Hibernate, iBatis, all the rest ended up winning the "battle" because you could hyperlink your way into the java bowels of the middleware and figure out why your stuff isn't working. Well, that and you didn't need bizarre-o transfer objects...
So, this is great if you're still using it (probably lots of people are) but, wow! Talk about a day late and a dollar short!
-G
I have been a Java programmer ever since it existed, but have only delved into the EJB side of things recently. I started using JPA a few months ago, and have tried Hibernate and TopLink Essentials (the default engine in J5EE). Hibernate is large and all-powerful, but for my needs, I have found TopLink to be a light, fast, and very clean design. The Glassfish developers have refactored and cleaned up a lot of the legacy code, and have cherry-picked a lot of the best design features from the other implementations. I imagine that this new code contribution will be able to provide a lot of the add-on tools that the average guy needs.
At first I didn't know what Persistence could add to my app. But I have been very impressed by the speed increase that caching the business object tree on the server side provides over low-level SQL manipulation.
While I applaud Oracle's move - I still don't know why any developer would consciously choose a single persistence solution and code to it when the Java Persistence API (JPA) standardizes the whole mess into a single, platform portable specification. Case in point - with my employers latest enterprise application, we decided to migrate to a true EE5 stack over some convoluted analgum of Spring/Hibernate/ActiveMQ/Acegi/XFire/Kitchen Sink, and originally pursued Glassfish as our container. After months of some successes and a lot of pain with some of Glassfish's less mature features and bugs, we decided to give JBoss 4.0.5 a run. Because we coded our persistence to JPA and not specifically to Hibernate or Toplink, we were able to pretty much effortlessly migrate between platforms, with the only real work being required when setting up container resources in each container (JMS Destinations, Connection Pools, et. al.). Glassfish uses TL as its underlying persistence implementation, and JBoss uses Hibernate. It was all the same to us.
For many (most?) needs, iBATIS is actually better. It does SQL mapping instead of O/R mapping.