-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Using of NamedQuery annotation
PostPosted: Tue Mar 21, 2006 10:35 am 
Beginner
Beginner

Joined: Mon Dec 05, 2005 4:15 am
Posts: 36
Since the NamedQuery can be applied only to the Entity class, and, as any annotation, cannot be applied more than once, I have a limitation - 1 NamedQuery per 1 Entity. But, I need often more then 1 NamedQuery. What strategy of using NamedQueried is recommended for the EJB3.0 environments?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 2:31 pm 
Newbie

Joined: Mon Mar 13, 2006 10:19 am
Posts: 4
Location: Germany
Hi sw79,

i think you are missing the @NameQueries annotation:

Code:
@NamedQueries ( {
      @NamedQuery (name = "syscounter.findAll", query = "select sc from SystemCounter sc"),
      @NamedQuery (name = "syscounter.findByName", query = "select sc from SystemCounter sc where sc.name = :name")
})


Hope this helps!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.