Hibernate query object SQL output

B

bb

Hi,
My team is using Hibernate. We are trying to get the Hibernate query
object to output pure SQL, not stuff like the following:

update T_CONTROL set id=?, max_order_number=?, max_requisition_number=?

where row_id=?

insert into T_CREDIT (id, vendor_id, amount, update_user,
update_timestamp, status, note, reason, date_paid, isas_id)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

In other words, get rid of the question marks and insert the ACTUAL
values that are being used. This would make debugging SQL errors a lot
easier.

I'm sure other's have a similar problem. Any help would be greatly
appreciated.
 
X

xlukasx

I don't know what you mean ... but you can change log level in log4j:
log4j.logger.org.hibernate.type=debug
This didn't replace question mark but you will be able to see values.

Greetings
luc
 
R

Rico

Hi,
My team is using Hibernate. We are trying to get the Hibernate query
object to output pure SQL, not stuff like the following:

update T_CONTROL set id=?, max_order_number=?, max_requisition_number=?

where row_id=?

insert into T_CREDIT (id, vendor_id, amount, update_user,
update_timestamp, status, note, reason, date_paid, isas_id)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

In other words, get rid of the question marks and insert the ACTUAL
values that are being used. This would make debugging SQL errors a lot
easier.

I'm sure other's have a similar problem. Any help would be greatly
appreciated.

humm... as luc mentioned, you can see the values being bound to the
parameters by adjusting the debug level.

for my part, I'd say that if I wanted to be debugging SQL errors, I
wouldn't be using Hibernate.

Rico.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top