Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Examples/JPA/Migration/Hibernate/V3Annotations

< EclipseLink‎ | Examples‎ | JPA‎ | Migration‎ | Hibernate
Revision as of 13:46, 15 July 2008 by Unnamed Poltroon (Talk)

This example catalogs the migration from Hibernate(TM) Annotations to EclipseLink JPA with its custom annotations. This is a work in progress so please feel free to add your comment

Entity Annotations

@org.hibernate.annotations.Entity

@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true,
		dynamicInsert = true, dynamicUpdate = true,
		optimisticLock = OptimisticLockType.ALL,
		polymorphism = PolymorphismType.EXPLICIT)

Custom Sequence Generator

In Hibernate a custom generator for sequence values can be defined and used as:

   @Id
   @GeneratedValue(generator = "system-uuid")
   @GenericGenerator(name = "system-uuid", strategy = "mypackage.UUIDGenerator")
   public String getTransactionGuid()

With EclipseLink a custom sequence generator can be implemented and registered for use using the @GeneratedValue. See: How to use Custom Sequencing (ie. UUID) for more details.

Mapping Annotation

Back to the top