-->
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: Using Native Sql and where clause
PostPosted: Fri Nov 21, 2008 9:53 am 
Newbie

Joined: Wed Nov 19, 2008 2:04 pm
Posts: 4
Hi,

I have to use native sql in hibernate.

when is issue the below query it is fetching records

String query="select order_number from oha" Query queryHql=hibernateSession.createSQLQuery(query.toString());
List list=queryHql.list();

it is fetching all records.

But when i add where condition

String query="select order_number from oha where xxx='CC'"

there comes no results eventhough there are records matching with the criteria.

Can anybody please guide me on how to use a simple native sql query with where clause.

Also I need some more info related to native subqueries using Hibernate

thanks in advance
Prasad Karri


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.