-->
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.  [ 5 posts ] 
Author Message
 Post subject: Mapping Problem
PostPosted: Fri Feb 19, 2010 4:30 am 
Newbie

Joined: Fri Feb 19, 2010 4:26 am
Posts: 8
Hi,

Is there a way where i can get table data with out having mapping file & with out bean class.
Because until runtime i don't know the table names where data needs to be fetched.
Please let me know if my question is not clear!!!!

Thnx in Advance
King


Top
 Profile  
 
 Post subject: Re: Mapping Problem
PostPosted: Fri Feb 19, 2010 5:54 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Session.createSQLQuery()


Top
 Profile  
 
 Post subject: Re: Mapping Problem
PostPosted: Fri Feb 19, 2010 6:00 am 
Newbie

Joined: Fri Feb 19, 2010 4:26 am
Posts: 8
Hi,

Thnx for the reply.

But,iam using Hibernate Template .
So,to use createSQLQuery shouldn't i pass Bean class in the query?
As i know syntax for createSQLQuery in hibernate and hibernate template are different.
Please send me example to use the same.

Thnx
Rana


Top
 Profile  
 
 Post subject: Re: Mapping Problem
PostPosted: Fri Feb 19, 2010 6:08 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I don't know anything about the HibernateTemplate, but with Session.createSQLQuery() you can create scalar queries that just return everything as an Object[].


Top
 Profile  
 
 Post subject: Re: Mapping Problem
PostPosted: Fri Feb 19, 2010 6:19 am 
Newbie

Joined: Fri Feb 19, 2010 4:26 am
Posts: 8
Ok,
using hibernate only can i use this method with the above specified criteria.

Ex: createSQLQuery("select count(1) from tbl_test ");

Can i pass directly table name here instead of Bean class..

(Iam using hibernate template in spring mvc)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.