NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Order By in @Named Query not working

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
SecurePAX



Joined: 22 Sep 2011
Posts: 4

PostPosted: Fri Jun 15, 2012 8:11 pm    Post subject: Order By in @Named Query not working Reply with quote

New to Jave, new to netbeans. I'm following the e-Commerce tut to get
up to speed.

ControllerServlet includes:
@EJB
private CrewFacade crewFacade;
...
@Override
public void init() throws ServletException {
// store employee list in servlet context
getServletContext().setAttribute("crewList",
crewFacade.findAll());

Crew.java includes:
@NamedQueries({
@NamedQuery(name = "Crew.findAll", query = "SELECT c FROM Crew c
ORDER BY c.lastName"),

Results looks like:
BROOKS
TRAVOLTA
TAYLOR
ADAMS
GAINS

Obviously not sorted. Cleaned and rebuilt before this note. Output is
complete, but not sorted. What's up? I need to get these simple
@Named Query mods understood, as I have 'multiple joins' and WHERE
clauses to add.

Any help? links to investigate? thanks in advance.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo