-->
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: General questions.
PostPosted: Sun Jun 10, 2007 3:32 am 
Newbie

Joined: Thu Apr 19, 2007 5:10 am
Posts: 5
Hello,

some general questions

1) how cann i make hibernate.cfg.xml configurable.
for example:
<many-to-one name="user" class="User"
insert="false" update="false">
<column name="user_id"/>
<formula>'TYPE'</formula>
</many-to-one>
the string 'TYPE' should be readed from property file. it should not be hardcoded in cfg.

2) is it possible to see all queries with values, which are executed by hibernate.

thx a lot in advance!


Top
 Profile  
 
 Post subject: Re: General questions.
PostPosted: Sun Jun 10, 2007 11:46 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
robertsv wrote:
1) how cann i make hibernate.cfg.xml configurable.
for example:
<many-to-one name="user" class="User"
insert="false" update="false">
<column name="user_id"/>
<formula>'TYPE'</formula>
</many-to-one>
the string 'TYPE' should be readed from property file. it should not be hardcoded in cfg.

Don't know for this one. Not sure it's possible.

robertsv wrote:
2) is it possible to see all queries with values, which are executed by hibernate.

Two solutions :
* activate org.hibernate.type package logs. You'll see what value is attached to each parameter (see the reference documentation for more details about this).
* configure p6spy proxy jdbc driver (search p6spy on google for more infos about this)

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject: Re: General questions.
PostPosted: Sun Jun 10, 2007 12:01 pm 
Newbie

Joined: Wed Apr 26, 2006 10:06 am
Posts: 7
robertsv wrote:
2) is it possible to see all queries with values, which are executed by hibernate.

thx a lot in advance!


in hibernate.cfg.xml:

<property name="show_sql">true</property>


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.