• Home
  • RSS Feed
  • Log in

JPA implementation patterns: Wrap-up
Posted by Vincent Partington in the early evening: July 13th, 2009

The previous blog in the JPA implementation patterns series discussed different ways to test your JPA code. Figuring out how to test DAO's and then being frustrated because the existing literature on JPA seemed to say very little on this subject, was actually the trigger for me to write these blogs. I have now come full circle, which means it's time to wrap up the series. There's lots more to write about, so keep following this blog! :-)

After discovering that there was a lack of documentation on how to use JPA in real-life scenario's, I have written a series of blogs about the JPA implementation patterns I discovered while writing JPA code. To wrap up the series, I have made an overview of all the patterns that have been discussed for easy reference. The list is mostly in chronological order. I only changed the order slightly to make a distinction between the basic patterns and the advanced patterns.

Basic patterns

  • Data Access Objects
  • Saving (detached) entities
  • Retrieving entities
  • Removing entities
  • Service Facades and Data Transfers Objects

Advanced patterns

  • Bidirectional assocations
  • Lazy loading
  • Bidirectional associations vs. lazy loading
  • Using UUIDs as primary keys (guest blog by Albert Sikkema)
  • Field access vs. property access
  • Mapping inheritance hierarchies
  • Testing

I hope these patterns will help you when writing your JPA application. If there is one thing to take away from this series is that it is pays off to really look into the details of JPA. Even though the promise of an abstraction layer invites you to take ORM for granted. Incorrect database usage is still Java EE performance problem #1, so there is a lot to gain here!

While writing down my experiences I have learned a lot about JPA. First of all because writing something down forces you to really look into the details, but most importantly because of the feedback I got on the blogs and after my presentation at J-Spring, the Dutch Java developer conference. And finally I would like to thank my colleague Albert Sikkema for his contribution to the series!

  • Share/Bookmark

Filed under JPA, JPA implementation patterns | 11 Comments »



11 Responses to “JPA implementation patterns: Wrap-up”



    crystal Says:
    Posted at: July 16, 2009 at 9:03 am

    i can’t even open java to download (core files won’t unzip) please help me.



    JPA Implementation Patterns « Fernando Franzini Java Blog Says:
    Posted at: July 16, 2009 at 1:13 pm

    [...] falta de documentação efetiva de como usar o JPA na vida real, Vincent Partington documentou uma série de patterns com o objetivo de ajudar e direcionar os projetistas a elaborem suas camadas de persistencias [...]



    J Aaron Farr Says:
    Posted at: July 17, 2009 at 6:48 pm

    where can i learn advanced patterns in java



    Ramkumar Says:
    Posted at: August 24, 2009 at 1:35 am

    I found the JPA presentation in Dutch very useful introduction to JPA. Thought it was too useful to remain in Dutch and used Yahoo’s Babel Fish service to translate it into English. Here is the URL of my attempt:

    (Original in Dutch):
    http://www.nljug.org/pages/events/content/jspring_2009/sessions/00027/

    Translation in English (as a Google Doc):
    http://docs.google.com/Doc?docid=0AZ8jw5JC8Og2ZGZmNTI4emtfMTJtZzRoYmNjag&hl=en



    Vincent Partington Says:
    Posted at: August 24, 2009 at 7:12 pm

    @Ramkumar: Thanks for the translation. Yahoo Babel Fish even seems to a pretty descent job of it. :-)



    JJ Says:
    Posted at: October 27, 2009 at 6:09 am

    Vincent, have you/will you create an FOS project that has the core classes and other ones to support the ideas you’ve presented? Would be good… :-)

    From a little searching, I saw projects create their own similar base classes within themselves (even FOS ones), and even one that tries to be stand alone (is nice, but has some goofy config needs that cause concern for me). It is uncoordinated.

    Would be good to create a simple clean one.



    Vincent Partington Says:
    Posted at: October 31, 2009 at 11:05 am

    @JJ: No, I have not created a project to bundle all this code. I don’t really think there is that much code to bundle… But please feel free to this so in my stead. By publishing the code I have placed it in the public domain already anyway. ;-)



    edansys » Blog Archive » links for 2009-12-02 Says:
    Posted at: December 3, 2009 at 2:44 am

    [...] JPA implementation patterns: Wrap-up | Xebia Blog (tags: JPA patterns) [...]



    ecapot Says:
    Posted at: December 11, 2009 at 3:50 pm

    Is there any JPA implementation pattern for storing internationalized data?
    I found some solutions for hibernate

    e.g. http://www.theserverside.com/tt/blogs/showblog.tss?id=HibernateInternational

    but nothing for JPA only.

    Perhaps someone can post suggestions or maybe JPA 2.0 solutions?



    JPA Implementation Patterns | Upthrust Says:
    Posted at: January 30, 2010 at 12:29 pm

    [...] for anyone who new to JPA. In this post I am going to summarize each and every post from ‘JPA Implementation Patterns‘ article [...]



    Jochen Szostek Says:
    Posted at: February 9, 2010 at 11:37 am

    Awesome set of interesting articles!



Leave a Reply

Click here to cancel reply.

Deployment automation for Java application running on Websphere, WebLogic and JBoss

Archives

  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009

Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India

Categories

  • Java (282)
  • Agile (109)
  • General (50)
  • Testing (42)
  • Performance (42)
  • Hibernate (36)
  • Scrum (33)
  • Podcast (31)
  • Architecture (31)
  • Spring (28)
  • SOA (24)
  • Maven (22)
  • Project Management (22)
  • Middleware (23)
    • Deployment (14)
  • Flex (17)
  • JPA (17)
  • Eclipse (15)
  • Xebia Labs (15)
  • Quality Assurance (14)

Tag Cloud

    product owner Java Performance Seam JavaOne Xebia Scala Agile Ajax Introduction to Agile Lean qcon Architecture IntelliJ Functional Programming Groovy Maven Hibernate Spring SOA Semantic Web esb Testing fitnesse XML Poppendieck Grails Closures Agile Awareness Workshop Scrum