-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem using database:MSSQL
PostPosted: Tue Feb 24, 2004 10:42 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
Hibernate version : 2.1rc1
Database : MSSQL Server 2000

Problem:
Parent/child association: I use Creatia, Example class to query, insert data.
1. Hibernate generate query sql using left outer join. But when I use Oracle, query sql using inner join. Is it right action in hibernate? How to know what kind of join(left outer join/inner join) will be used when I use Creatia and Example to query data? Can I specify a right join way?

2. When I query data from parent table, I found the result different between Oracle and SQL Server.
e.g.
Code:
Parent table
id name
Child table
id parent_id

My query code is like this:
Code:
Criteria crit = session.createCriteria(ParentModel.class);
crit.add(Example.create(parentModel));
crit.list();


Data in table:
Code:
Parent table:
id = 1, name = "55"
Child table:
id = 1, parent_id = 1
id = 2, parent_id = 1


If database is Oracle, the result will be one ParentModel instance and instance has a set of children with two child.
If database is MSSQL, the result will be two ParentModel instances and both instances have a set of children with two child.
So I am very strange. Is is a bug in version 2.1rc1?

And I also found problem on inserting data into parent table with a set of children. Detail description is here: http://forum.hibernate.org/viewtopic.php?p=2191785#2191785

Can somebody help me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.