-->
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.  [ 2 posts ] 
Author Message
 Post subject: Newbie Question
PostPosted: Tue Jun 27, 2006 7:45 pm 
Newbie

Joined: Tue Jun 27, 2006 7:35 pm
Posts: 3
Hi,
Wanted to quickly debug my hibernate session. The query being generated is as shown :

select xyz from table whhere column=?

My point is, how do I configure hibernate to show the PARAMETERS that have been assigned to the '?'

Am new to this so any help would be appreciated.

My query is getting messed up somewhere, although the values is being passed correctly to this code.

protected List find(String whereClause, Object[] values ,Session session)
{
Query query = session.createQuery(whereClause);
int numParams = values.length;
for (int i = 0; i < numParams; i++)
{
query.setParameter(i, values[i]);
}

List found = query.list();
return found;
}
Hibernate version:3.0.5

Name and version of the database you are using: Sybase ASE 12.5.2

The generated SQL (show_sql=true):select xyz from table whhere column=?

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 7:59 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Turn on debug logging for org.hibernate.type. Put this into your log4j.properties file:
Code:
log4j.logger.org.hibernate.type=DEBUG

_________________
Code tags are your friend. Know them and use them.


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