<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>all that jazztoplink</title>
    <link>http://jazzy.id.au/default/tags/toplink/</link>
    <description>james' blog about java and all that jazz</description>
    <language>en</language>
    <copyright>James Roper</copyright>
    <pubDate>Sat, 12 May 2012 07:02:00 GMT</pubDate>
    <dc:creator>James Roper</dc:creator>
    <dc:date>2012-05-12T07:02:00Z</dc:date>
    <dc:language>en</dc:language>
    <dc:rights>James Roper</dc:rights>
    <image>
      <title>all that jazztoplink</title>
      <url>http://jazzy.id.au/default/tags/toplink/</url>
    </image>
    <item>
      <title>JPA 2.0 - Early Review</title>
      <link>http://jazzy.id.au/default/2008/05/06/jpa_2_0_early_review.html</link>
      <content:encoded>&lt;p&gt;
A few days ago, &lt;a href="http://jcp.org/en/jsr/detail?id=317"&gt;JSR-317&lt;/a&gt;, the specification request for JPA 2.0, released an &lt;a href="http://jcp.org/aboutJava/communityprocess/edr/jsr317/index.html"&gt;early draft review&lt;/a&gt; of the specification.  Today I had the chance to skim through it to see what new things it had to offer.
&lt;/p&gt;

&lt;p&gt;
Something I commented on in an &lt;a href="2008/03/24/jpa_2_0_new_features_part_1.html"&gt;earlier&lt;/a&gt; blog post was how they might implement deleting orphan members of an association.  Would they follow TopLink's private collection mapping, or use Hibernate's additional delete orphan cascade type?  It turns out, they chose neither... or rather, they met half way.  The EDR specifies the addition of a boolean &lt;tt&gt;orphanRemoval&lt;/tt&gt; attribute on the &lt;tt&gt;@OneToMany&lt;/tt&gt; and &lt;tt&gt;@OneToOne&lt;/tt&gt; annotations.  So the terminology follows the Hibernate orphan terminology, however hibernate uses a &lt;tt&gt;DELETE_ORPHAN&lt;/tt&gt; cascade type.  The method though is more similar to TopLink, which has private ownership as a property of a collection mapping.
&lt;/p&gt;

&lt;p&gt;
I don't think that I like this way of doing it.  I don't think it's consistent, if I want a new entity to be persisted just by adding it to a collection, then I specify &lt;tt&gt;cascade=PERSIST&lt;/tt&gt;.  But if I want an existing entity to be deleted just by removing it from a collection, then I specify &lt;tt&gt;orphanRemoval=true&lt;/tt&gt;.  Cascading persistence to members added to collections and removing orphaned elements are both similar operations, in that they indirectly change the life cycle state of an entity, that occur at flush time, in a cascade like manner.  I think it would be more consistent to say &lt;tt&gt;cascade=ORPHAN_REMOVE&lt;/tt&gt;.  The expert group has made a note in the EDR asking for input on which strategy they should use.
&lt;/p&gt;</content:encoded>
      <category domain="http://jazzy.id.au/default/categories/java/">Java</category>
      <category domain="http://jazzy.id.au/default/tags/hibernate/">hibernate</category>
      <category domain="http://jazzy.id.au/default/tags/java/">java</category>
      <category domain="http://jazzy.id.au/default/tags/jpa/">jpa</category>
      <category domain="http://jazzy.id.au/default/tags/toplink/">toplink</category>
      <pubDate>Tue, 06 May 2008 12:15:00 GMT</pubDate>
      <guid isPermaLink="false">tag:jazzy.id.au,2008-05-06:default/1210076100000</guid>
      <dc:date>2008-05-06T12:15:00Z</dc:date>
    </item>
    <item>
      <title>JPA 2.0 - New features - Part 1</title>
      <link>http://jazzy.id.au/default/2008/03/24/jpa_2_0_new_features_part_1.html</link>
      <content:encoded>In my previous blog post I wrote about asking the JPA presenter at the Sun Tech Days if JPA will support collections of basic types.  I've now done some research of my own and found that most of the features that I miss most in JPA, compared to Hibernate, will be in JPA.&lt;p class="paragraph"/&gt;Let me start by saying that the first version of the Java Persistence API is excellent.  Standardising three major competing vendors of ORM technologies, Hibernate, JDO and Toplink, into one standard would have been by no means an easy task.  It certainly would have been an easy way out for the expert group to produce an API that included only the features they could agree on, but did not include many of the fundamental features of an ORM framework.  I feel however that all the core aspects of ORM concepts have been addressed, the things that were left out were not essential.  This is where JPA 2.0 comes in.  Now that JPA has gained industry acceptance, it is time to fill the standard out, include all those nice to have features and clean it up around the edges.&lt;p class="paragraph"/&gt;The JPA 2.0 specification has yet to be proposed as a JSR, so nothing that I'm about to mention is definitely going to be in there.  All of the information I'm providing is based on presentations that I've read given by the people who will be involved in specifying JPA 2.0.  In this article I will start us off by looking at the enhancements we can expect in collection mapping.&lt;p&gt;&lt;a href="http://jazzy.id.au/default/2008/03/24/jpa_2_0_new_features_part_1.html"&gt;Read more...&lt;/a&gt;&lt;/p&gt;</content:encoded>
      <category domain="http://jazzy.id.au/default/categories/java/">Java</category>
      <category domain="http://jazzy.id.au/default/tags/hibernate/">hibernate</category>
      <category domain="http://jazzy.id.au/default/tags/java/">java</category>
      <category domain="http://jazzy.id.au/default/tags/jpa/">jpa</category>
      <category domain="http://jazzy.id.au/default/tags/toplink/">toplink</category>
      <pubDate>Mon, 24 Mar 2008 01:16:00 GMT</pubDate>
      <guid isPermaLink="false">tag:jazzy.id.au,2008-03-24:default/1206321360000</guid>
      <dc:date>2008-03-24T01:16:00Z</dc:date>
    </item>
    <item>
      <title>Sun on JPA</title>
      <link>http://jazzy.id.au/default/2008/03/20/sun_on_jpa.html</link>
      <content:encoded>&lt;p&gt;A few weeks ago I attended the Sun Tech Days in Sydney.  I was pretty impressed with the breakfast they provided.  In fact, all the food was great.  The whole place had a really geeky feel to it, and I really liked that too.  However, the presentations left me feeling that the whole thing was a waste of time.  To be fair, some of the presentations were good.  It was excellent to hear James Gosling.  But the majority of the presentations I went to were terrible.&lt;/p&gt;

&lt;p&gt;I don't think my standards are too high in having this gripe, at one level, Sun provided me with free food and a day where I could mix with like minded people, I shouldn't be complaining.  But it just frustrated me so much because Sun could have done so much more for not only me, but also themselves at this event.  The whole event is one gigantic sales pitch, and I'm ok with that.  I want Sun to get me excited about their products, I want Sun to get me excited about Java development, I want Sun to pitch their best sales pitch at me, do their best to make me want to drop everything that is not Sun, and follow them.  Not that I would necessarily do that, but I at least want Sun to sell themselves to me if I go to an event like this.  But I think they failed to do that.  I'm going to use one particular session, the session on JPA, as an example of how they missed the mark, but most of the sessions I felt were the same.&lt;/p&gt;

&lt;p&gt;My expectations from the JPA session were that Sun would sell me JPA.  I love Hibernate, I use it for all my database access, I know how it works intimately, and I am very quick to recommend it as the best tool for ORM to every man and his dog.  The big problem for me is that part of my reason for loving it is based in my ignorance, I've only briefly touched JPA, and I've never used Toplink or JDO, they could all be miles ahead of Hibernate, but I wouldn't know.  This is why I went to JPA session.  I wanted to be given reasons why I should try it, I wanted to be given insights into the future of JPA that will make it the best ORM API to use.  So when the session ended up being JPA101 - This is how to map an entity with annotations, this is how to do inheritance, this is how to write a query in JPAQL, you can imagine my disappointment.&lt;/p&gt;

&lt;p&gt;I'm not sure who Sun is expecting to come to their tech days.  But I'll take a guess at the sort of people that do come.  For a start, they are people that take an interest in modern Java frameworks, if they weren't, they wouldn't be at the days.  They are developers, if they aren't developers then they definitely wouldn't be interested in JPA101 anyway.  And they're people that take the initiative to do research and learn about new technologies themselves, otherwise they wouldn't have found out about the tech days to start with.  So, I would expect the people described above to have all had experience with at least one of the leading ORM tools.  A JPA101 would have been way too simple for almost the entire audience.&lt;/p&gt;

&lt;p&gt;In want of more meat on JPA, I asked a question about the future of JPA.  "Is it likely that in the future JPA will support collections of basic types, eg Strings, Integers, Dates?".  I was shocked by the presenters response.  It wasn't that he didn't know the answer to the question, he didn't understand the question.  After asking me to repeat the question, he said "well, it does support it".  I said no it doesn't, and someone else in the audience piped up and agreed with me, adding that you could map collections of basic types using TopLink or Hibernate extensions.  To which the presenter replied "there's your answer".  The presenter had no idea.  Anyone with real world experience in an ORM tool would have encountered a time when they would have wanted a collection of basic types, and an expert in JPA would know that JPA doesn't support this.  I wanted to know why it doesn't support it, maybe there's a good reason, maybe they felt there were difficulties in how to specify it and so left it for the next release.  This guy clearly was not an expert in JPA, and clearly had never used JPA in the real world.  I doubt if he had any experience beyond learning enough to give the presentation, it's likely that someone else wrote the presentation and he just went off that persons notes.&lt;/p&gt;

&lt;p&gt;So I was very disappointed overall with the Sun Tech Days.  It was marketed at professionals, but most of the sessions were targeted at newbies.  I hope there's someone at Sun that understands JPA, if they can't get that person to give a presentation, maybe they should look into getting local respected industry professionals to give the presentations, that would be a lot more helpful.  Until Sun does that, I don't think I'll return.&lt;/p&gt;</content:encoded>
      <category domain="http://jazzy.id.au/default/categories/java/">Java</category>
      <category domain="http://jazzy.id.au/default/tags/hibernate/">hibernate</category>
      <category domain="http://jazzy.id.au/default/tags/java/">java</category>
      <category domain="http://jazzy.id.au/default/tags/jpa/">jpa</category>
      <category domain="http://jazzy.id.au/default/tags/sun/">sun</category>
      <category domain="http://jazzy.id.au/default/tags/toplink/">toplink</category>
      <pubDate>Thu, 20 Mar 2008 07:25:00 GMT</pubDate>
      <guid isPermaLink="false">tag:jazzy.id.au,2008-03-20:default/1205997900000</guid>
      <dc:date>2008-03-20T07:25:00Z</dc:date>
    </item>
  </channel>
</rss>


