How can a JPA 1.0 project be converted to JPA 2.0?

2.4k Views Asked by At

We've been using JPA 1.0 for some time now. We want to move ahead to JPA 2.0. How can this be done?

2

There are 2 best solutions below

0
On BEST ANSWER

We changed the version name and xsd as the following:

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">

Which worked fine.

Please mention in comments if you think additional things need to be done and I will update this answer.

11
On

You could do worse than to read the migration guide from OpenJPA and then ask a more specific question.