openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: Perfered way to convert JPA2 annotations to a persistence.xml based mapping file?
Date Mon, 18 Jul 2011 14:16:25 GMT
If the tables have already been created you can use OpenJPA's reverse
mapping tool<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_reverse>.
It will recreate the .java files for you in addition to the XML mapping
file. There's no need to use the generated .java files though.

If you don't have the tables created, you could use the OpenJPA forward
mapping tool
<http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_mappingtool>to
create the temporary database. Then use the reverse mapping tool to create
the XML file.

I'm not aware of a tool that writes the XML mapping files without going to a
database, but this should at least get you started.

-mike

On Sun, Jul 17, 2011 at 8:34 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:

> What is the perfered way to convert JPA2 annotated entities to an XML
> mapping
> file?
>
> We are using openjpa 2.1.
>
> -Jason
>
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -                                                               -
> - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> - Principal Consultant              10 West 24th Street #100    -
> - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> -                                                               -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message