Home / Java Patterns and Pitfalls     frequal.com

Switching JPA Providers

JPA provides a standard interface for communicating with persistence providers like Hibernate and OpenJPA. Everything from annotations to APIs are specified in the spec. Switching providers should be as easy as editing the <provider> element in persistence.xml. In reality, there are several things you may have to change to make a smooth transition.

Schema Generation

Metadata Generation

Named Queries

JPA requires that fields be qualified. However, Hibernate is tolerant of missing qualifiers. When switching to other providers, be sure to add the identification variable name to the path expression.
Last modified on 30 May 2012 by AO

Copyright © 2024 Andrew Oliver