Hi Kevin,

yes that was my question. Thank you, Lars

2008/3/28, Kevin Sutter <[EMAIL PROTECTED]>:
>
> 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 <[EMAIL PROTECTED]>
> wrote:
>
>
> > Any advice?
> >
> > 2008/3/27, Lars Vogel <[EMAIL PROTECTED]>:
> > >
> > > 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
> > >
> >
>

Reply via email to