-->
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: Problem in Example
PostPosted: Sun Feb 22, 2004 11:40 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
I used Example last project with database:Oracle. And now in current project I used MSSQL. But I find there is something different performence in using Example between MSSQL and Oracle.
I config a many-to-one association in two table.
Code:
table foo column: id, name
table bar column:id, foo_id, bar_name

My java search code
Code:
foo.setName("11");
bar.setFoo(foo);
bar.setBarName("22");
...
crit.add(Example.create(foo));
crit.list();


In Oracle, I find hibernate will generate sql like this:
select xxx from bar inner join foo on bar.foo_id = foo.id where bar.bar_name=? and foo.name=?

But in MSSQL, hibernate will generate sql like this:
select xxx frm bar out join foo on bar.foo_id = foo.id where bar.bar_name=?

It doesn't include any conditions on parent table(in this case, foo.name) and use out join instead of inner join in Oracle.

My question is:Is it correct action in Hibernate?How to represent same function like in Oracle?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 22, 2004 11:43 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
Sorry, there is a mistake in search code above.It should be the following:
Code:
foo.setName("11");
bar.setFoo(foo);
bar.setBarName("22");
...
crit.add(Example.create(bar));
crit.list();


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.