Gateway Java User's Group

Gateway JUG

Growing Java Developers... One Class At A Time


Home Meeting Info News Resources About Us Contact Us  

Next Meeting Snapshot

An Annotation A Day Will Keep The XML Away ...

Got Jobs?

When:
May 6th, 2008  

What:
Java Persistence API

Where:
Lutheran Hour Ministries Building  

Who's Presenting:
Jack Frosch



New Forums

May Meeting Topic:

Java Persistence API

Meeting Sponsored By:

COMSYS Web logo

You're cordially invited to attend the next Gateway JUG meeting on May 6th at 6:00pm. We'll be treated to a presentation on the Java Persistence API. Please RSVP to rsvp@gatewayjug.org if you plan to attend.

Presentation

Java Persistence API

How are you handling database persistence in your Java project? Hopefully, you're not still hand-coding JDBC. Even if you're using Hibernate, Apache OJB, TopLink or some other persistence framework, chances are you're still mapping your Java persistence objects to a relational database using XML. This means an update to the Java class almost always requires editing the XML file to make the corresponding change there. This violates the spirit of the DRY principle (Don't Repeat Yourself) and often causes extra developer cycles to fix issues caused by mismatched mapping files and Java classes. Ideally, a change to the Java class would be all that is needed.

That's where Java Persistence API (JPA) comes in.

JPA borrows heavily from the lessons learned with Hibernate, but extends ease of development with the elimination of most of the XML mapping files. Instead of XML, Java annotations are used to map between our object world and the relational world. Introduced in JDK 1.5, annotations allow us to decorate our classes with meta-data information needed to accomplish seamless and automatic persistence. JPA goes a step further by promoting a "convention over configuration" style of programming. Accept the conventions, and a class needs only a single annotation to be identified as persistent. However, JPA offers plenty of flexibility to allow customizations beyond the conventions.

Though borrowing from Hibernate, JPA doesn't require you use Hibernate as your persistence provider. This opens the door to developing applications that are truly persistence framework agnostic - without resorting to using more complex architectures for persistence isolation.

But what about EJB EntityBeans? They're simply gone in EJB3!

Java Persistence API now forms the core of JEE/EJB3 persistence, with EntityBeans being replaced by POJOs using JPA.  However, JPA was deemed so useful, that it was made to work with Java Standard Edition (SE) applications. Unfortunately, JPA is not yet bundled with Java SE and still needs to be downloaded as part of a JEE download, like Glassfish or JBoss. Fortunately, tooling for JPA is widely available in all the major IDEs, so adding JPA to a Java SE desktop application is pretty easy if you use an IDE.

In this presentation, we will discuss and demonstrate:

  • The Object-Relational Mapping Problem
  • Adding JPA to Your Project
  • Mapping Unidirectional and Bidirectional Associations
    • One-to-One
    • One-to-Many
    • Many-to-Many
  • Cascading Changes
  • Mapping Strategies to Implement Inheritance
  • Mapping Embedded Objects
  • Implementing Queries

If you have something in particular you would like addressed at the meeting, please drop note to president@gatewayjug.org.

Presenter

Jack Frosch

M81 Galaxy
From Hubble Heritage site, http://heritage.stsci.edu

Jack Frosch founded the JUG more than seven years ago to promote Java and educate developers on new and interesting Java APIs, tips, and techniques.

He came off a project with Learjet in February 2008 and is currently on assignment with a university consortium developing a grant proposal development and management application.

Jack regularly presents on a variety of interesting Java topics targeted at beginner and intermediate java developers. He also hosts group study classes and workshops at his training facility.

He's currently conducting the Gateway JUG's Java Web Developer group study class.

His hobbies and interests include astronomy & physics, politics, and life at the pub.

Door Prizes

We usually have a bounty of food, refreshments, and door prizes. We regularly give away books, gift cards, and other door prizes. This month, we have several great books to give away.

Now, A Word From Our Meeting Meeting Sponsor...

COMSYS “Putting IT to Work!”

COMSYS has continued success placing IT professionals in very lucrative positions with companies here in the Greater St. Louis Area and Nationwide.   We pride ourselves on the longevity of our contracts and successful conversion rates to permanent employment with these great companies.    At COMSYS we offer full benefits, competitive compensation (hourly or salaried) as well as continued learning with certifications in many IT areas.  
COMSYS’ main focus has always been excellence in IT staffing— providing the right technical resources for projects.  COMSYS has built a reputation with IT managers and executives for delivering resources both qualified and suitable for the job. Our recruiting methodology and proprietary systems enable us to match skills, experience and aptitudes while ensuring a cultural fit.
COMSYS delivers talent across the entire spectrum of staffing and project requirements. Our scalable enterprise recruiting model and infrastructure combine to meet all just-in-time resource requirements. We can deliver:

  • a single resource or an entire team
  • an individual project manager – or a project manager with a team
  • a team of consultants with COMSYS oversight and your project management
  • project outsourcing: onsite, offsite or offshore
  • vendor management solutions: onsite or vendor neutral, including recruitment process outsourcing and service procurement outsourcing

Contact:

Stephanie Grimshaw
Placement Manager  
Comsys
16253 Swingley Ridge Rd
Ste 210
Chesterfield, MO 63017
636-532-6241 ph
314-604-6914 cell
636-519-0218 fx
sgrimshaw@comsys.com
IM:stephseel (Yahoo)
www.comsys.com
“Putting IT to Work”
Ask me about our Referral Bonus Program!
http://www.linkedin.com/in/stephgrimshaw

Meeting Site

We meet in the Lutheran Hour Ministries building at 660 Mason Ridge Center, St. Louis, MO 63141. This is off of the north outer road, near Highway 40 & Mason, just east of the AAA building. Directions & Maps

General

The Gateway JUG normally holds its general membership meetings the first Tuesday of each month from 6pm - 8pm at the Lutheran Hour Ministries building. Need directions? At every meeting, we'll treat you to food and refreshments, useful information, and a chance to win door prizes.

Please RSVP to rsvp@gatewayjug.org if you plan to attend.

These meetings are always free and open to the public. They cover topics on Java™ APIs, tools, and methodologies and are presented so beginners and advanced developers alike can take something away from the presentation. The JUG also provides some light refreshments for all attendees as well as great door prizes.

In order that we may plan for refreshments and seating, please RSVP by s 12pm on the Monday prior to the meeting. Simply e-mail the following information to rsvp@gatewayjug.org:

  • Number of attendees
  • Company Name (if any)
  • Name of attendee(s)
  • E-mail Address of attendee(s) (in case a last minute change needs to be broadcast; i.e. snow cancellation)
 

Sponsor A JUG Meeting & Tell Us About Them!

To sponsor a meeting,
just email us


Recent Meeting Sponsors:


April 2008

NetEffects Logo
February 2008

CDI

January 2008


November 2007


October 2007

Objistics
September 2007


August 2007

Clayton Computer Logo


June 2007

Chameleon

May 2007

CDI
April 2007


March 2007

Objistics
February 2007

Adaptive Solutions Group
December 2006

Objistics
November 2006


October 2006

CDI
September 2006

NetEffects Logo
August 2006

Daugherty Logo
June 2006

CDI Logo
May 2006

CDI Logo
April 2006


March 2006


February 2006


January 2006

NextGen IS
December 2005

Objistics
November 2005


October 2005


September 2005

Objistics
August 2005


June 2005


May 2005


April 2005


New Forums



Gateway JUG activities are made possible through your support and the valuable support of our Sponsors:

AAA Objistics