openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Vogel" <lars.vo...@googlemail.com>
Subject Re: Mapping of table in persistence.xml
Date Mon, 31 Mar 2008 11:15:16 GMT
Hi Kevin,

It did not work. I have posted a new question to this email group. Best
regards, Lars

2008/3/29, Lars Vogel <lars.vogel@googlemail.com>:
>
> Hi Kevin,
>
> yes that was my question. Thank you, Lars
>
> 2008/3/28, Kevin Sutter <kwsutter@gmail.com>:
> >
> > Lars,
> > Table and field mapping via xml is not done in the persitence.xml.  It
> > is
> > only done as part of an orm.xml file.  Any defined orm.xml files that
> > you
> > wish to use need to be specified in your persistence.xml using the
> > <mapping-file> element.  But, the actual mapping is done in your
> > orm.xmlfile.
> >
> > So, if you have a file named orm.xml, your persistence.xml would have
> > something like this:
> >
> > <persistence-unit name="mypu">
> >     :
> >     <mapping-file>META-INF/orm.xml</mapping-file>
> >     :
> > </persistence-unit>
> >
> > Is this what you were asking about?
> >
> > Thanks,
> > Kevin
> >
> > On Fri, Mar 28, 2008 at 5:11 AM, Lars Vogel <lars.vogel@googlemail.com>
> > wrote:
> >
> >
> > > Any advice?
> > >
> > > 2008/3/27, Lars Vogel <lars.vogel@googlemail.com>:
> > > >
> > > > Hi,
> > > >
> > > > Can you please sent me an example in which the mapping to a certain
> > > table
> > > > is done in persistence.xml?
> > > >
> > > > I use orm.xml to map the class to a certain table:
> > > >
> > > > <entity class="datamodel.Person">
> > > >       <table name="MYAPPLICATION.PEOPLETABLE"/>
> > > >         <attributes>
> > > >             <id name="id" />
> > > >             <basic name="firstName" />
> > > >             <basic name="lastName" />
> > > >             <transient name="nonsenseField" />
> > > >         </attributes>
> > > >     </entity>
> > > >
> > > > I read that I have to do the same mapping in persistence.xml in the
> > > class
> > > > but I failed to find an example to get the right tag.
> > > >
> > > > <class>datamodel.Person</class>
> > > >
> > > > If I run this without this setting I receive the message:
> > > >
> > > > Could not locate metadata for the class using alias "
> > > > MYAPPLICATION.PEOPLETABLE".
> > > >
> > > > Best regards, Lars
> > > >
> > >
> >
>
>

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