Migration from OpenJPA to EclipseLink JPA: Extended Functionality
Note: Under Construction
OpenJPA does offers some extended functionality that goes beyond the JPA specification the following sections describe these features and how you migrate to the corresponding functionality in EclipseLink. If there are additional features not covered in this page or the materials provided are incomplete for your needs please log a documentation enhancement request referencing this page describing the migration challenge.
- Inheritance Casting
- Native SQL with POJO results
- Detached (Serialized) entities & relationships
- PersistentCollection: When the OpenJPA specific @org.apache.openjpa.persistence.PersistentCollection annotation is used with an array of objects field type, a new table is created for this field. Simply removing the @PersistentCollection annotation without a replacement will result in this new table not being created.
- In order to continue using the existing table created for the array of objects field, the following adjustments to the entity class can be made:
- Replace the @org.apache.openjpa.persistence.PersistentCollection annotation with @javax.persistence.ElementCollection and @Column(name="ELEMENT")
- Change the array to be a collection of objects.
@PersistentCollection private int arrayOfInts;
@ElementCollection @Column(name="ELEMENT") private List<Integer> arrayOfInts;