Desert Code Camp Fall 2011

I'll be attending Desert Code Camp tomorrow (today). The event will be going from about 9 to like 4:30pm. I'm going to be presenting on Spring Data JPA. Just a volunteer thing. Anyway, I built a presentation here using Prezi.com. Its a pretty sweet service. I also threw together a bit of a demo and posted it on github. Its nothing much, but contains a working example of using Spring Data JPA with general repos along with Specifications. Check it out.

Advanced Spring-Data JPA: Specifications and Querydsl

20,000 foot view

Stop creating a method for every query permutation. Specifications wrap the JPA Criteria API. Using them makes your code less - and then more - readable and reusable. Check them out.

If you don't like the ugliness that is implementing individual specifications, Querydsl based Specifications make everything better.

Do yourself a favor and read this article: Springsource Blog: Advanced Spring Data JPA Specifications and Querydsl

Note: JPA InheritanceType.JOINED

Hey, make sure to annotate child model classes with @PrimaryKeyJoinColumn when using InheritanceType.JOINED. This annotation allows you to specify the column names to be used in mapping parent child relationships.

Additional reading:

  1. API
  2. JEE 6 - Entity Inheritance Tutorial - fantastically incomplete
Its important to note that using this inheritance model requires an extra join operation when retrieving entities. This may negatively impact performance if running high volume or with anything other than trivial inheritance models.