-->
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.  [ 3 posts ] 
Author Message
 Post subject: Native generic sql query problem
PostPosted: Thu Jun 21, 2007 7:41 am 
Newbie

Joined: Mon Jun 11, 2007 4:42 am
Posts: 7
Location: Italy
I have to make native sql query without knowing in advace which query it will be, for example something like this:

sqlQuery=... // a query string get from a input file from a socket
List results = systemSession.createSQLQuery(sqlQuery).list();

is it possible in Hibernate? All the example i found need a scalar to be added or a entity class to be added, but I can't do that as i don't know how the sql statement will be (possibly i don't want to make a sql parser to get which is the pieces in the sql statement).

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 11:50 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Hi Julius,

if you do not specify addScalar or addEntity then hibernate will use
type autodetection. The types are defined in the Dialect-Class.

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 2:01 am 
Newbie

Joined: Mon Jun 11, 2007 4:42 am
Posts: 7
Location: Italy
Hi steckemetz

Thanks for your reply, this is a first step in the right direction!


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