users@jaxb.java.net

Re: question about hyperjaxb3

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 17 May 2011 17:09:11 +0200

Hi,

>   first of all i want to thank you for the great hyperjaxb project, I've
> really appreciated your work.

You are welcome.

> I'm evaluating hyperjaxb to implement the persistence layer of a "service
> oriented application".
> I successfully followed the tutorial on the wiki pages and generated JPA
> annotated entities in two different ways:
>
> using the maven-hyperjaxb3-plugin
> invoking it via the cxf-codegen-plugin
>
> I need to change the persistence unit name for the generated entities (I've
> many persistence context that I need to merge).
> For case 1, I can change the persistence unit name using the
> persistenceUnitName configuration property.
> How can I address this issue in case 2?
> This is an extract of my pom file.
>                 <plugin>
>                         <groupId>org.apache.cxf</groupId>
>                         <artifactId>cxf-codegen-plugin</artifactId>
>                         <version>2.2.6</version>
>                         <executions>
>                             <execution>
>                                 <id>generate-sources</id>
>                                 <phase>generate-sources</phase>
>                                 <goals>
>                                     <goal>wsdl2java</goal>
>                                 </goals>
>                             </execution>
>                         </executions>
>                         <configuration>
>                             <wsdlOptions>
>                                 <wsdlOption>
>                                     <wsdl>
>
> ${basedir}/src/main/resources/project.wsdl
>                                     </wsdl>
>                                     <bindingFiles>
>
>
> <bindingFile>${basedir}/src/main/resources/binding.xjb</bindingFile>
>                                     </bindingFiles>
>                                     <extraargs>
>
> <extraarg>-xjc-Xhyperjaxb3-ejb</extraarg>
>                                         <extraarg>-xjc-XhashCode</extraarg>
>                                         <extraarg>-xjc-Xequals</extraarg>
>                                         <extraarg>-xjc-XtoString</extraarg>
>
> <extraarg>-autoNameResolution</extraarg>
>                                     </extraargs>
>                                 </wsdlOption>
>                             </wsdlOptions>

Try

<extraarg>-xjc-Xhyperjaxb3-ejb-persistenceUnitName=com.acme.foo</extraarg>

Bye,
/lexi