Tuesday, November 27, 2007

Sahoo's Javac Plugin for Persistence.xml Generation

In the article Better JPA, Better JAXB, and Better Annotations Processing with Java SE 6, I wrote about using JAXB to generate a Java Persistence API (JPA) object-relational mapping (ORM) file (usually called orm.xml) from in-source JPA annotations. In that article, I mentioned Sahoo's blog on using the Java 5 apt tool to generate a persistence.xml file. Sahoo has now posted a blog entry on A javac Plugin to Manage Your persistence.xml in which he demonstrates using javac in different contexts (directly, Maven, etc.) to generate a JPA persistence.xml file.

In a related blog, Sahoo lists some of his observations and experiences using the Java SE 6 annotation processor.

The persistence.xml file and the orm.xml (or one or more files fulfilling the same purpose) are the two main outside-of-code configuration files needed with JPA. The OTN article I cited above talks about generation of the orm.xml or equivalent file from in-source annotations and Sahoo's blogs cover creation of the persistence.xml file.

No comments: