-->
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: help with Example
PostPosted: Sun Jan 22, 2006 10:04 am 
Newbie

Joined: Wed Dec 28, 2005 4:54 pm
Posts: 10
HI everybody!!!!
I have a table that I call Explanation that has a one to many relation with another called Problem. I'm trying to select any Explanation that has an specific charasteristic, using something like this:

ArrayList results = null ;

NHibernateUtil.beginTransaction();// Stating a transaction
results = (ArrayList)NHibernateUtil.getSession()
.CreateCriteria(typeof(Explanation))
.Add(Example.Create(ob).IgnoreCase())
.List();

And when I use the parameter ob to pass an Explanation I had created with an specific Problem and it does'nt return anything.
I don't know if is a trouble with the nhibernate mapping or something else.
help please


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 22, 2006 2:48 pm 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
I suggest watching the sql being generated (either with log4net or event with kind of sql profiler)

Post the sql here if it after that still having a problem.

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 28, 2006 11:39 am 
Newbie

Joined: Wed Dec 28, 2005 4:54 pm
Posts: 10
michal wrote:
I suggest watching the sql being generated (either with log4net or event with kind of sql profiler)

Post the sql here if it after that still having a problem.



Could you please tell how to do that???


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 28, 2006 9:02 pm 
Newbie

Joined: Wed Feb 23, 2005 1:02 pm
Posts: 13
Location: Sacramento, CA
does your Example.Create have
a transaction in it, that actually commits the data?

You can turn on the flag show-sql="true" in your hibernate config or properties file.

_________________
-Joel Thompson

http://www.rhinosystemsinc.com
Specializing in Oracle, Java and J2EE Systems for Unix and Windows platforms


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 3:39 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
Quote:
Could you please tell how to do that???

log4net: http://hibernate.org/364.html

But if you are using MS Sql Server there is simple method which I personally prefer for quick watch - just use Sql Server Profiler tool.
For alternative databases, I'm sure there are simmillar tools.

I strongly suggest having sql-watch feature on the hand, without it spotting the problem can be real pain ;)

_________________
michal


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.