persistence@glassfish.java.net

RE: Re: Named Queries

From: Trimble Daniel - dtrimb <Daniel.Trimble_at_acxiom.com>
Date: Thu, 24 Aug 2006 14:34:57 -0500

Error: Cannot find the declaration of element 'entity-mappings'.

What's going wrong?

File:
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="1.0">
   <named-query
name="GetContactsForTeamLastNameDesc">Select...</named-query>
   <named-query
name="GetContactsForTeamLastNameAsc">Select...</named-query>
   <named-query
name="GetContactsForTeamFirstNameDesc">Select...</named-query>
   <named-query
name="GetContactsForTeamFirstNameAsc">Select...</named-query>
   <named-query
name="GetContactsForTeamUserIDDesc">Select...</named-query>
   <named-query
name="GetContactsForTeamUserIDAsc">Select...</named-query>
   <named-query
name="GetContactsForTeamCompanyNameDesc">Select...</named-query>
   <named-query
name="GetContactsForTeamCompanyNameAsc">Select...</named-query>
</entity-mappings>

-----Original Message-----
From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM]
Sent: Thursday, August 24, 2006 2:06 PM
To: persistence_at_glassfish.dev.java.net
Subject: Re: Named Queries

Use META-INF/orm.xml.
e.g.
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
version="1.0">
   <named-query name="query1">...</named-query>
   <named-query name="query2">...</named-query>
</entity-mappings>

Thanks,
Sahoo

Trimble Daniel - dtrimb wrote:
>
> I am looking for a better way to organized Named Queries. I think that

> putting them into a list at the top of a class is messy and makes the
> code hard to read. Any suggestions would help.
>
>
>
> Daniel Trimble
>
>
************************************************************************
***
> The information contained in this communication is confidential, is
> intended only for the use of the recipient named above, and may be
legally
> privileged.
>
> If the reader of this message is not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of
this
> communication is strictly prohibited.
>
> If you have received this communication in error, please resend this
> communication to the sender and delete the original message or any
copy
> of it from your computer system.
>
> Thank You.
>
************************************************************************
****
>