My requirement is to save a huge XML values to database.
After analyzing few options I finalized that generate entity bean classes from huge xml and then persist it using h
Here's some documentation:
http://confluence.highsource.org/display/HJ3/Making+schema-derived+classes+ready+for+JPA
http://java.net/projects/hyperjaxb
Here's a working example for a project I have completed:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.4</version>
<dependencies>
<dependency>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3-ejb-plugin</artifactId>
<version>0.5.5</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-domain1</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<strict>false</strict>
<schemaIncludes>
<value>account.xsd</value>
<value>customer.xsd</value>
<value>address.xsd</value>
</schemaIncludes>
<bindingIncludes>
<include>domain-bindings.xjb</include>
</bindingIncludes>
<extension>true</extension>
<generatePackage>your.package.here</generatePackage>
<generateDirectory>${project.build.directory}/generated-sources/jaxbandjpa</generateDirectory>
<args>
<arg>-Xannotate</arg>
<arg>-Xhyperjaxb3-ejb</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.0</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>0.6.0</version>
</plugin>
</plugins>
</configuration>
</execution>
</executions>
</plugin>
hope it helps
You could use HyperJAXB to generate a JAXB model with JPA annotations. Hibernate implements the JPA specification: