Download

Understanding the Examples

Employee Model

The employee model has existed in TopLink and EclipseLink since the mid 90's. The model has evolved a little over the years based on enhancements made available in the mappings.

JPA 2.0 and Extended Features

When updated for EclipseLink 2.1 several JPA 2.0 features were introduced to the model and its mappings. These include:

PhoneNumber now mapped using derived identifiers so its primary key of EMP_ID and PTYPE are mapped with PhoneNumber.owner and PhoneNumber.type. The previous redundant mapping of PhoneNumber.id has been removed.

While the majority of the Employee examples use pure JPA mappings several extensions offered by EclipseLink are highlgted including:

Employee.gender mapped to the enum Gender using a converter to store a single char code in the database instead of the full enum's name or oridinal position.