-->
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.  [ 1 post ] 
Author Message
 Post subject: createQuery and specific fiields
PostPosted: Fri Jul 30, 2010 4:26 am 
Newbie

Joined: Fri Jul 30, 2010 4:05 am
Posts: 1
Hi,

Im new to Hibernate and not sure (also after reading documentation) what the best way to go is.
In my code I have specified to execute the following query:

Code:
List<Auction> results = em.createQuery("select a from Auction a where lower(a.name) like #{auctionSearchNamePattern}")
                .setMaxResults(pageSize + 1)
                .setFirstResult(page * pageSize)
                .getResultList();


The results are displayed on a JSF form, but I only show the name and description field. When I look at the select statement generated, all the fields are in the select statement.
Although this is only a small test project to get to know Seam and Hibernate, I feel it would be better to only select the fields I really need, since there is a potentially large blob in each record also.
So, should I worry about all the fields being in the select? Im wondering what the best way to go is in these kinds of situations.

Thanks s much for your time!


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

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.